mirror of
https://github.com/wahyd4/cert-manager.git
synced 2026-08-09 05:06:38 +10:00
Make lastTransitionTime a pointer
Signed-off-by: James Munnelly <james@munnelly.eu>
This commit is contained in:
@@ -63,7 +63,7 @@ func SetIssuerCondition(i cmapi.GenericIssuer, conditionType cmapi.IssuerConditi
|
||||
}
|
||||
|
||||
nowTime := metav1.NewTime(Clock.Now())
|
||||
newCondition.LastTransitionTime = nowTime
|
||||
newCondition.LastTransitionTime = &nowTime
|
||||
|
||||
// Search through existing conditions
|
||||
for idx, cond := range i.GetStatus().Conditions {
|
||||
@@ -126,7 +126,7 @@ func SetCertificateCondition(crt *cmapi.Certificate, conditionType cmapi.Certifi
|
||||
}
|
||||
|
||||
nowTime := metav1.NewTime(Clock.Now())
|
||||
newCondition.LastTransitionTime = nowTime
|
||||
newCondition.LastTransitionTime = &nowTime
|
||||
|
||||
// Search through existing conditions
|
||||
for idx, cond := range crt.Status.Conditions {
|
||||
|
||||
@@ -151,7 +151,7 @@ type CertificateCondition struct {
|
||||
// LastTransitionTime is the timestamp corresponding to the last status
|
||||
// change of this condition.
|
||||
// +optional
|
||||
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
|
||||
LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"`
|
||||
|
||||
// Reason is a brief machine readable explanation for the condition's last
|
||||
// transition.
|
||||
|
||||
@@ -540,7 +540,7 @@ type IssuerCondition struct {
|
||||
// LastTransitionTime is the timestamp corresponding to the last status
|
||||
// change of this condition.
|
||||
// +optional
|
||||
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
|
||||
LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"`
|
||||
|
||||
// Reason is a brief machine readable explanation for the condition's last
|
||||
// transition.
|
||||
|
||||
@@ -539,7 +539,10 @@ func (in *Certificate) DeepCopyObject() runtime.Object {
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *CertificateCondition) DeepCopyInto(out *CertificateCondition) {
|
||||
*out = *in
|
||||
in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime)
|
||||
if in.LastTransitionTime != nil {
|
||||
in, out := &in.LastTransitionTime, &out.LastTransitionTime
|
||||
*out = (*in).DeepCopy()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -947,7 +950,10 @@ func (in *Issuer) DeepCopyObject() runtime.Object {
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *IssuerCondition) DeepCopyInto(out *IssuerCondition) {
|
||||
*out = *in
|
||||
in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime)
|
||||
if in.LastTransitionTime != nil {
|
||||
in, out := &in.LastTransitionTime, &out.LastTransitionTime
|
||||
*out = (*in).DeepCopy()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ func TestSync(t *testing.T) {
|
||||
Status: cmapi.ConditionFalse,
|
||||
Reason: "NotFound",
|
||||
Message: "Certificate does not exist",
|
||||
LastTransitionTime: nowMetaTime,
|
||||
LastTransitionTime: &nowMetaTime,
|
||||
}),
|
||||
)
|
||||
exampleCertTemporaryCondition := gen.CertificateFrom(exampleCert,
|
||||
@@ -123,7 +123,7 @@ func TestSync(t *testing.T) {
|
||||
Status: cmapi.ConditionFalse,
|
||||
Reason: "TemporaryCertificate",
|
||||
Message: "Certificate issuance in progress. Temporary certificate issued.",
|
||||
LastTransitionTime: nowMetaTime,
|
||||
LastTransitionTime: &nowMetaTime,
|
||||
}),
|
||||
)
|
||||
|
||||
@@ -479,7 +479,7 @@ func TestSync(t *testing.T) {
|
||||
Status: cmapi.ConditionFalse,
|
||||
Reason: "DoesNotMatch",
|
||||
Message: "Certificate private key does not match certificate",
|
||||
LastTransitionTime: nowMetaTime,
|
||||
LastTransitionTime: &nowMetaTime,
|
||||
}),
|
||||
gen.SetCertificateNotAfter(metav1.NewTime(cert2.NotAfter)),
|
||||
),
|
||||
@@ -568,7 +568,7 @@ func TestSync(t *testing.T) {
|
||||
Status: cmapi.ConditionTrue,
|
||||
Reason: "Ready",
|
||||
Message: "Certificate is up to date and has not expired",
|
||||
LastTransitionTime: nowMetaTime,
|
||||
LastTransitionTime: &nowMetaTime,
|
||||
}),
|
||||
gen.SetCertificateNotAfter(metav1.NewTime(cert1.NotAfter)),
|
||||
),
|
||||
@@ -705,7 +705,7 @@ func TestSync(t *testing.T) {
|
||||
Status: cmapi.ConditionFalse,
|
||||
Reason: "DoesNotMatch",
|
||||
Message: "Issuer of the certificate is not up to date: \"not-test\"",
|
||||
LastTransitionTime: nowMetaTime,
|
||||
LastTransitionTime: &nowMetaTime,
|
||||
}),
|
||||
gen.SetCertificateNotAfter(metav1.NewTime(cert1.NotAfter)),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user