Skip to content

Commit 79aa96d

Browse files
Merge pull request #1979 from vrutkovs/RewritePrimaryCertBundleSecret
OCPBUGS-59526: certgraphanalysis: remove hash from primary cert bundle secret
2 parents 9723791 + 18b712c commit 79aa96d

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)