mirror of
https://github.com/rancher/dynamiclistener.git
synced 2025-07-16 15:41:17 +00:00
Avoid panic when secret is nil
This commit is contained in:
parent
dc7452dbb8
commit
ff22834bde
@ -179,7 +179,7 @@ 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.Annotations != nil {
|
||||
if secret != nil && secret.Annotations != nil {
|
||||
return secret.Annotations[Static] == "true"
|
||||
}
|
||||
return false
|
||||
|
Loading…
Reference in New Issue
Block a user