@@ -158,6 +158,7 @@ func ensureOwnerReference(meta *metav1.ObjectMeta, owner *metav1.OwnerReference)
158
158
func needNewSigningCertKeyPair (secret * corev1.Secret , refresh time.Duration , refreshOnlyWhenExpired bool ) (bool , string ) {
159
159
annotations := secret .Annotations
160
160
notBefore , notAfter , reason := getValidityFromAnnotations (annotations )
161
+
161
162
if len (reason ) > 0 {
162
163
return true , reason
163
164
}
@@ -191,15 +192,15 @@ func getValidityFromAnnotations(annotations map[string]string) (notBefore time.T
191
192
}
192
193
notAfter , err := time .Parse (time .RFC3339 , notAfterString )
193
194
if err != nil {
194
- return notBefore , notAfter , fmt .Sprintf ("bad expiry: %q" , notAfterString )
195
+ return notBefore , notAfter , fmt .Sprintf ("bad notAfter expiry: %q" , notAfterString )
195
196
}
196
197
notBeforeString := annotations [CertificateNotBeforeAnnotation ]
197
- if len (notAfterString ) == 0 {
198
+ if len (notBeforeString ) == 0 {
198
199
return notBefore , notAfter , "missing notBefore"
199
200
}
200
201
notBefore , err = time .Parse (time .RFC3339 , notBeforeString )
201
202
if err != nil {
202
- return notBefore , notAfter , fmt .Sprintf ("bad expiry: %q" , notBeforeString )
203
+ return notBefore , notAfter , fmt .Sprintf ("bad notBefore expiry: %q" , notBeforeString )
203
204
}
204
205
205
206
return notBefore , notAfter , ""
0 commit comments