@@ -166,6 +166,66 @@ var _ = Describe("certmanager module", func() {
166
166
Expect (cert .Labels ["f" ]).To (Equal ("l" ))
167
167
})
168
168
169
+ It ("creates certificate with orderdered DNSNames" , func () {
170
+ c := certmanager .NewCertificate (
171
+ certmanager .Cert (
172
+ names .CertName .Name ,
173
+ names .CertName .Namespace ,
174
+ map [string ]string {"f" : "l" },
175
+ certmgrv1.CertificateSpec {
176
+ CommonName : "keystone-public-openstack.apps-crc.testing" ,
177
+ DNSNames : []string {
178
+ "keystone-public-openstack.apps-crc.testing" ,
179
+ "keystone-public-openstack" ,
180
+ },
181
+ IssuerRef : certmgrmetav1.ObjectReference {
182
+ Kind : "Issuer" ,
183
+ Name : "issuerName" ,
184
+ },
185
+ SecretName : "secret" ,
186
+ },
187
+ ),
188
+ timeout ,
189
+ )
190
+
191
+ _ , _ , err := c .CreateOrPatch (ctx , h , nil )
192
+ Expect (err ).ShouldNot (HaveOccurred ())
193
+ cert := th .GetCert (names .CertName )
194
+ Expect (cert .Spec .DNSNames [0 ]).To (Equal ("keystone-public-openstack" ))
195
+ Expect (cert .Spec .DNSNames [1 ]).To (Equal ("keystone-public-openstack.apps-crc.testing" ))
196
+ })
197
+
198
+ It ("creates certificate with orderdered IPAddresses" , func () {
199
+ c := certmanager .NewCertificate (
200
+ certmanager .Cert (
201
+ names .CertName .Name ,
202
+ names .CertName .Namespace ,
203
+ map [string ]string {"f" : "l" },
204
+ certmgrv1.CertificateSpec {
205
+ CommonName : "keystone-public-openstack.apps-crc.testing" ,
206
+ IPAddresses : []string {
207
+ "2.2.2.2" ,
208
+ "1.1.1.1" ,
209
+ "2.2.2.1" ,
210
+ },
211
+ IssuerRef : certmgrmetav1.ObjectReference {
212
+ Kind : "Issuer" ,
213
+ Name : "issuerName" ,
214
+ },
215
+ SecretName : "secret" ,
216
+ },
217
+ ),
218
+ timeout ,
219
+ )
220
+
221
+ _ , _ , err := c .CreateOrPatch (ctx , h , nil )
222
+ Expect (err ).ShouldNot (HaveOccurred ())
223
+ cert := th .GetCert (names .CertName )
224
+ Expect (cert .Spec .IPAddresses [0 ]).To (Equal ("1.1.1.1" ))
225
+ Expect (cert .Spec .IPAddresses [1 ]).To (Equal ("2.2.2.1" ))
226
+ Expect (cert .Spec .IPAddresses [2 ]).To (Equal ("2.2.2.2" ))
227
+ })
228
+
169
229
It ("deletes certificate" , func () {
170
230
c := certmanager .NewCertificate (
171
231
certmanager .Cert (
0 commit comments