Skip to content

Commit 18b712c

Browse files
committed
certgraphanalysis: remove hash from primary cert bundle secret
ROSA Hypershift tests create this secret with a certificate, but its name always starts with a random hash. This option would allow us to replace the variable part so that this certificate could be tracked in TLS registry
1 parent 4760434 commit 18b712c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/certs/cert-inspection/certgraphanalysis/metadata_options.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,15 @@ var (
149149
return timestampReg.ReplaceAllString(path, "<timestamp>.pem")
150150
},
151151
}
152+
RewritePrimaryCertBundleSecret = &metadataOptions{
153+
rewriteSecretFn: func(secret *corev1.Secret) {
154+
if secret.Namespace != "openshift-ingress" || !strings.HasSuffix(secret.Name, "-primary-cert-bundle-secret") {
155+
return
156+
}
157+
hash := strings.TrimSuffix(secret.Name, "-primary-cert-bundle-secret")
158+
secret.Name = strings.ReplaceAll(secret.Name, hash, "<hash>")
159+
},
160+
}
152161
)
153162

154163
// skipRevisionedInOnDiskLocation returns true if location is for revisioned certificate and needs to be skipped

0 commit comments

Comments
 (0)