From f373fc1c7c4bc064ccd1dfe4d6e1ab20759812dc Mon Sep 17 00:00:00 2001 From: Dan Ramich Date: Fri, 23 Apr 2021 14:55:44 -0600 Subject: [PATCH] Update IsStatic to check for nil annotations --- factory/gen.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/factory/gen.go b/factory/gen.go index ff15a93..b1aafe0 100644 --- a/factory/gen.go +++ b/factory/gen.go @@ -179,7 +179,10 @@ 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 { - return secret.Annotations[Static] == "true" + if secret.Annotations != nil { + return secret.Annotations[Static] == "true" + } + return false } // NeedsUpdate returns true if any of the CNs are not currently present on the