Updates the CRDs with the Certificate Condition observedGeneration field

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
This commit is contained in:
joshvanl 2021-01-28 15:50:12 +00:00
parent d02f043354
commit b3cab7e265
3 changed files with 19 additions and 3 deletions

View File

@ -293,6 +293,10 @@ spec:
message:
description: Message is a human readable description of the details of the last transition, complementing reason.
type: string
observedGeneration:
description: If set, this represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.condition[x].observedGeneration is 9, the condition is out of date with respect to the current state of the Certificate.
type: integer
format: int64
reason:
description: Reason is a brief machine readable explanation for the condition's last transition.
type: string
@ -588,6 +592,10 @@ spec:
message:
description: Message is a human readable description of the details of the last transition, complementing reason.
type: string
observedGeneration:
description: If set, this represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.condition[x].observedGeneration is 9, the condition is out of date with respect to the current state of the Certificate.
type: integer
format: int64
reason:
description: Reason is a brief machine readable explanation for the condition's last transition.
type: string
@ -885,6 +893,10 @@ spec:
message:
description: Message is a human readable description of the details of the last transition, complementing reason.
type: string
observedGeneration:
description: If set, this represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.condition[x].observedGeneration is 9, the condition is out of date with respect to the current state of the Certificate.
type: integer
format: int64
reason:
description: Reason is a brief machine readable explanation for the condition's last transition.
type: string
@ -1182,6 +1194,10 @@ spec:
message:
description: Message is a human readable description of the details of the last transition, complementing reason.
type: string
observedGeneration:
description: If set, this represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.condition[x].observedGeneration is 9, the condition is out of date with respect to the current state of the Certificate.
type: integer
format: int64
reason:
description: Reason is a brief machine readable explanation for the condition's last transition.
type: string

View File

@ -184,7 +184,7 @@ func TestIssuingController(t *testing.T) {
}
// Add Issuing condition to Certificate
apiutil.SetCertificateCondition(crt, cmapi.CertificateConditionIssuing, cmmeta.ConditionTrue, "", "")
apiutil.SetCertificateCondition(crt, crt.Generation, cmapi.CertificateConditionIssuing, cmmeta.ConditionTrue, "", "")
crt.Status.NextPrivateKeySecretName = &nextPrivateKeySecretName
crt.Status.Revision = &revision
crt, err = cmCl.CertmanagerV1().Certificates(namespace).UpdateStatus(ctx, crt, metav1.UpdateOptions{})
@ -395,7 +395,7 @@ func TestIssuingController_PKCS8_PrivateKey(t *testing.T) {
}
// Add Issuing condition to Certificate
apiutil.SetCertificateCondition(crt, cmapi.CertificateConditionIssuing, cmmeta.ConditionTrue, "", "")
apiutil.SetCertificateCondition(crt, crt.Generation, cmapi.CertificateConditionIssuing, cmmeta.ConditionTrue, "", "")
crt.Status.NextPrivateKeySecretName = &nextPrivateKeySecretName
crt.Status.Revision = &revision
crt, err = cmCl.CertmanagerV1().Certificates(namespace).UpdateStatus(ctx, crt, metav1.UpdateOptions{})

View File

@ -566,7 +566,7 @@ CertificateRequest:
func setCertificateStatus(cmCl versioned.Interface, crt *cmapi.Certificate,
status *cmapi.CertificateStatus, ctx context.Context) (*cmapi.Certificate, error) {
for _, cond := range status.Conditions {
apiutil.SetCertificateCondition(crt, cond.Type, cond.Status, cond.Reason, cond.Message)
apiutil.SetCertificateCondition(crt, crt.Generation, cond.Type, cond.Status, cond.Reason, cond.Message)
}
crt.Status.NotAfter = status.NotAfter
crt.Status.Revision = status.Revision