Don't panic checking a nil secret for static annotation

This commit is contained in:
Darren Shepherd
2020-09-09 22:50:14 -07:00
parent 12c01f1e2b
commit 8a4e63348c

View File

@@ -179,6 +179,9 @@ func populateCN(secret *v1.Secret, cn ...string) *v1.Secret {
// IsStatic returns true if the Secret has an attribute indicating that it contains
// a static (aka user-provided) certificate, which should not be modified.
func IsStatic(secret *v1.Secret) bool {
if secret == nil {
return false
}
return secret.Annotations[Static] == "true"
}