Addressed CR comments to also fix Ingress
@@ -1099,10 +1099,16 @@ var _ = SIGDescribe("Export", func() {
Expect(vmExport.Status.Links.External.Cert).To(Equal(testCert))
certs, err := certutil.ParseCertsPEM([]byte(vmExport.Status.Links.External.Cert))
Expect(err).ToNot(HaveOccurred())
- Expect(certs).To(HaveLen(1))
+ Expect(certs).ToNot(BeEmpty())
prefix := fmt.Sprintf("%s-%s", components.VirtExportProxyServiceName, flags.KubeVirtInstallNamespace)
domainName := strings.TrimPrefix(ingress.Spec.Rules[0].Host, prefix)
- Expect(matchesCNOrAlt(certs[0], domainName)).To(BeTrue())
+ matchesCNOrAltName := false
+ for _, cert := range certs {
+ if matchesCNOrAlt(cert, domainName) {
+ matchesCNOrAltName = true
+ }
+ }
+ Expect(matchesCNOrAltName).To(BeTrue())
Expect(vmExport.Status.Links.External.Volumes[0].Formats[0].Url).To(ContainSubstring(ingress.Spec.Rules[0].Host))
})
})
@@ -1126,6 +1132,7 @@ var _ = SIGDescribe("Export", func() {
checkExportSecretRef(vmExport)
certs, err := certutil.ParseCertsPEM([]byte(vmExport.Status.Links.External.Cert))
Expect(err).ToNot(HaveOccurred())
+ Expect(certs).ToNot(BeEmpty())
route := getExportRoute()
host := ""
if len(route.Status.Ingress) > 0 {
