Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KUBESAW-43: Replace the special ToolchainClusterCondition with the standard toolchain Condition #416

Merged
merged 12 commits into from
May 30, 2024
33 changes: 2 additions & 31 deletions api/v1alpha1/toolchaincluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@ package v1alpha1
// Most of the code was copied from the KubeFedCluster CRD of the KubeFed project https://github.com/kubernetes-sigs/kubefed

import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

type ToolchainClusterConditionType string

// These are valid conditions of a cluster.
const (
// ToolchainClusterReady means the cluster is ready to accept workloads.
ToolchainClusterReady ToolchainClusterConditionType = "Ready"
// ToolchainClusterOffline means the cluster is temporarily down or not reachable
ToolchainClusterOffline ToolchainClusterConditionType = "Offline"
ToolchainClusterOffline ConditionType = "Offline"

ToolchainClusterClusterReadyReason = "ClusterReady"
ToolchainClusterClusterNotReadyReason = "ClusterNotReady"
Expand Down Expand Up @@ -73,7 +68,7 @@ type LocalSecretReference struct {
type ToolchainClusterStatus struct {
// Conditions is an array of current cluster conditions.
// +listType=atomic
Conditions []ToolchainClusterCondition `json:"conditions"`
Conditions []Condition `json:"conditions"`
}

//+kubebuilder:object:root=true
Expand All @@ -100,30 +95,6 @@ type ToolchainCluster struct {
Status ToolchainClusterStatus `json:"status,omitempty"`
}

// ToolchainClusterCondition describes current state of a cluster.
// +k8s:openapi-gen=true
type ToolchainClusterCondition struct {
// Type of cluster condition, Ready or Offline.
Type ToolchainClusterConditionType `json:"type"`
// Status of the condition, one of True, False, Unknown.
Status corev1.ConditionStatus `json:"status"`
// Last time the condition was checked.
// +optional
LastProbeTime metav1.Time `json:"lastProbeTime"`
// Last time the condition was updated
// +optional
LastUpdatedTime *metav1.Time `json:"lastUpdatedTime,omitempty"`
// Last time the condition transit from one status to another.
// +optional
LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"`
// (brief) reason for the condition's last transition.
// +optional
Reason string `json:"reason,omitempty"`
// Human readable message indicating details about last transition.
// +optional
Message string `json:"message,omitempty"`
}

//+kubebuilder:object:root=true

// ToolchainClusterList contains a list of ToolchainCluster
Expand Down
26 changes: 1 addition & 25 deletions api/v1alpha1/zz_generated.deepcopy.go

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

70 changes: 2 additions & 68 deletions api/v1alpha1/zz_generated.openapi.go

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

Loading