@@ -158,6 +158,7 @@ func ensureOwnerReference(meta *metav1.ObjectMeta, owner *metav1.OwnerReference)
158158func needNewSigningCertKeyPair (secret * corev1.Secret , refresh time.Duration , refreshOnlyWhenExpired bool ) (bool , string ) {
159159 annotations := secret .Annotations
160160 notBefore , notAfter , reason := getValidityFromAnnotations (annotations )
161+
161162 if len (reason ) > 0 {
162163 return true , reason
163164 }
@@ -191,15 +192,15 @@ func getValidityFromAnnotations(annotations map[string]string) (notBefore time.T
191192 }
192193 notAfter , err := time .Parse (time .RFC3339 , notAfterString )
193194 if err != nil {
194- return notBefore , notAfter , fmt .Sprintf ("bad expiry: %q" , notAfterString )
195+ return notBefore , notAfter , fmt .Sprintf ("bad notAfter expiry: %q" , notAfterString )
195196 }
196197 notBeforeString := annotations [CertificateNotBeforeAnnotation ]
197- if len (notAfterString ) == 0 {
198+ if len (notBeforeString ) == 0 {
198199 return notBefore , notAfter , "missing notBefore"
199200 }
200201 notBefore , err = time .Parse (time .RFC3339 , notBeforeString )
201202 if err != nil {
202- return notBefore , notAfter , fmt .Sprintf ("bad expiry: %q" , notBeforeString )
203+ return notBefore , notAfter , fmt .Sprintf ("bad notBefore expiry: %q" , notBeforeString )
203204 }
204205
205206 return notBefore , notAfter , ""
0 commit comments