Skip to content

Commit 263dbc1

Browse files
committed
use cluster status instead of cp and managedEtcd status
1 parent 771af60 commit 263dbc1

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

controllers/cloudstackfailuredomain_controller.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ import (
3232
)
3333

3434
const (
35-
conditionTypeManagedEtcdReady = "ManagedEtcdReady"
36-
conditionStatusFalse = "False"
35+
conditionTypeReady = "Ready"
36+
conditionStatusFalse = "False"
3737
)
3838

3939
// CloudStackFailureDomainReconciler is the k8s controller manager's interface to reconcile a CloudStackFailureDomain.
@@ -158,11 +158,8 @@ func (r *CloudStackFailureDomainReconciliationRunner) GetAllMachinesInFailureDom
158158
func (r *CloudStackFailureDomainReconciliationRunner) RequeueIfClusterNotReady() (ctrl.Result, error) {
159159
if len(r.Machines) > 0 {
160160
for _, condition := range r.CAPICluster.Status.Conditions {
161-
if condition.Type == clusterv1.ControlPlaneReadyCondition && condition.Status == conditionStatusFalse {
162-
return r.RequeueWithMessage("cluster control plane not ready,")
163-
}
164-
if condition.Type == conditionTypeManagedEtcdReady && condition.Status == conditionStatusFalse {
165-
return r.RequeueWithMessage("cluster managed etcd not ready,")
161+
if condition.Type == conditionTypeReady && condition.Status == conditionStatusFalse {
162+
return r.RequeueWithMessage("cluster status not ready,")
166163
}
167164
}
168165
}

controllers/cloudstackfailuredomain_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ var _ = Describe("CloudStackFailureDomainReconciler", func() {
8585
Ω(err).ShouldNot(HaveOccurred())
8686
dummies.CAPICluster.Status.Conditions = []clusterv1.Condition{
8787
{
88-
Type: "ControlPlaneReady",
88+
Type: "Ready",
8989
Status: "False",
9090
},
9191
}

0 commit comments

Comments
 (0)