diff --git a/virtualcluster/pkg/apis/tenancy/v1alpha1/virtualcluster_types.go b/virtualcluster/pkg/apis/tenancy/v1alpha1/virtualcluster_types.go index b5286179..a29981ed 100644 --- a/virtualcluster/pkg/apis/tenancy/v1alpha1/virtualcluster_types.go +++ b/virtualcluster/pkg/apis/tenancy/v1alpha1/virtualcluster_types.go @@ -63,7 +63,7 @@ type VirtualClusterStatus struct { // +optional ClusterNamespace string `json:"clusterNamespace,omitempty"` - // A human readable message indicating details about why the cluster is in + // A human-readable message indicating details about why the cluster is in // this condition. // +optional Message string `json:"message"` @@ -102,7 +102,7 @@ type ClusterCondition struct { // Last time the condition transitioned from one status to another. // +optional - LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` + LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` // Unique, one-word, CamelCase reason for the condition's last transition. // +optional diff --git a/virtualcluster/pkg/apis/tenancy/v1alpha1/zz_generated.deepcopy.go b/virtualcluster/pkg/apis/tenancy/v1alpha1/zz_generated.deepcopy.go index e4063860..3caeab3b 100644 --- a/virtualcluster/pkg/apis/tenancy/v1alpha1/zz_generated.deepcopy.go +++ b/virtualcluster/pkg/apis/tenancy/v1alpha1/zz_generated.deepcopy.go @@ -30,7 +30,10 @@ import ( // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterCondition) DeepCopyInto(out *ClusterCondition) { *out = *in - in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) + if in.LastTransitionTime != nil { + in, out := &in.LastTransitionTime, &out.LastTransitionTime + *out = (*in).DeepCopy() + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCondition. diff --git a/virtualcluster/pkg/controller/util/kube/util.go b/virtualcluster/pkg/controller/util/kube/util.go index a822f6ad..c7f35009 100644 --- a/virtualcluster/pkg/controller/util/kube/util.go +++ b/virtualcluster/pkg/controller/util/kube/util.go @@ -172,9 +172,10 @@ func SetVCStatus(vc *tenancyv1alpha1.VirtualCluster, phase tenancyv1alpha1.Clust vc.Status.Message = message vc.Status.Reason = reason vc.Status.Conditions = append(vc.Status.Conditions, tenancyv1alpha1.ClusterCondition{ - LastTransitionTime: metav1.NewTime(time.Now()), + LastTransitionTime: &metav1.Time{Time: time.Now()}, Reason: reason, Message: message, + Status: corev1.ConditionTrue, }) }