Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

🐛Fix VirtualCluster CRD and reconciler for work in 1.19+1.20 environment #316

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion virtualcluster/pkg/controller/util/kube/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
}

Expand Down