Skip to content

Commit

Permalink
KUBESAW-43: Replace the special ToolchainClusterCondition with the st…
Browse files Browse the repository at this point in the history
…andard toolchain Condition (#416)

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

Signed-off-by: Feny Mehta <[email protected]>

* Updating condition type

Signed-off-by: Feny Mehta <[email protected]>

* removing the toolchaincluster special condition

Signed-off-by: Feny Mehta <[email protected]>

* review comments
Signed-off-by: Feny Mehta <[email protected]>

---------

Signed-off-by: Feny Mehta <[email protected]>
Co-authored-by: Francisc Munteanu <[email protected]>
  • Loading branch information
fbm3307 and mfrancisc authored May 30, 2024
1 parent 12b7932 commit c11598c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 124 deletions.
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.

0 comments on commit c11598c

Please sign in to comment.