forked from github/dynamiclistener
Don't panic checking a nil secret for static annotation
This commit is contained in:
@@ -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"
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user