Skip to content

Commit c04ce1d

Browse files
authored
Use ControlPlaneInitialized to determine if cluster is ready to connect. (#324)
1 parent e5d9ec4 commit c04ce1d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

justfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,14 @@ release-manifests: _create-out-dir _download-kustomize
170170
# Full e2e test of importing cluster in fleet
171171
test-import: start-dev deploy deploy-child-cluster deploy-kindnet deploy-app && collect-test-import
172172
kubectl wait pods --for=condition=Ready --timeout=150s --all --all-namespaces
173-
kubectl wait cluster --timeout=500s --for=condition=ControlPlaneReady=true docker-demo
173+
kubectl wait cluster --timeout=500s --for=condition=ControlPlaneInitialized=true docker-demo
174174
kubectl wait clusters.fleet.cattle.io --timeout=500s --for=condition=Ready=true docker-demo
175175
kubectl wait ns default --timeout=500s --for=jsonpath='{.metadata.annotations.field\.cattle\.io\/allow-fleetworkspace-creation-for-existing-namespace}=true'
176176

177177
# Full e2e test of importing cluster in fleet
178178
test-import-rke2: start-dev deploy deploy-child-rke2-cluster deploy-calico-gitrepo deploy-app
179179
kubectl wait pods --for=condition=Ready --timeout=150s --all --all-namespaces
180-
kubectl wait cluster --timeout=500s --for=condition=ControlPlaneReady=true docker-demo
180+
kubectl wait cluster --timeout=500s --for=condition=ControlPlaneInitialized=true docker-demo
181181
kubectl wait clusters.fleet.cattle.io --timeout=500s --for=condition=Ready=true docker-demo
182182

183183
collect-test-import:

src/controllers/cluster.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use super::controller::{
3434
};
3535
use super::{BundleResult, ClusterSyncError, ClusterSyncResult};
3636

37-
pub static CONTROLPLANE_READY_CONDITION: &str = "ControlPlaneReady";
37+
pub static CONTROLPLANE_INITIALIZED_CONDITION: &str = "ControlPlaneInitialized";
3838

3939
pub struct FleetClusterBundle {
4040
namespace: Namespace,
@@ -293,7 +293,7 @@ impl Cluster {
293293
let status = self.status.clone()?;
294294
let cp_ready = status.control_plane_ready.filter(|&ready| ready);
295295
let ready_condition = status.conditions?.iter().find_map(|c| {
296-
(c.type_ == CONTROLPLANE_READY_CONDITION && c.status == "True").then_some(true)
296+
(c.type_ == CONTROLPLANE_INITIALIZED_CONDITION && c.status == "True").then_some(true)
297297
});
298298

299299
ready_condition.or(cp_ready).map(|_| self)

0 commit comments

Comments
 (0)