You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Follow-up PR to disable local agent
There was a problem when testing the code merged in in Rancher, as the
implementation was using the bootstrap controller + a label in the
Cluster to disable the local agent.
Rancher does not enable the boostrap controller, so that approach is
only valid for Fleet standalone.
This PR is a follow-up to that approach and tracks the value using a
config-driven approach this time.
Refers to: #4807
---------
Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
// Before deleting anything, make absolutely sure the kubeconfig points at
571
-
// the management cluster itself. isLocalCluster already gated us here based
572
-
// on metadata, but tearing down an agent is destructive, so we confirm
573
-
// cluster identity for real.
575
+
// the management cluster itself. manageagent.IsLocalCluster already gated us
576
+
// here based on metadata, but tearing down an agent is destructive, so we
577
+
// confirm cluster identity for real.
574
578
isLocal, err:=i.isManagementCluster(kc)
575
579
iferr!=nil {
576
580
returnerr
577
581
}
578
582
if!isLocal {
579
583
logrus.Warnf(
580
-
"Cluster import for '%s/%s'. Refusing to remove agent: label %s=true is set but the cluster reached through its kubeconfig is not the management cluster",
"Cluster import for '%s/%s'. Refusing to remove agent: localAgentDisabled is set but the cluster reached through its kubeconfig is not the management cluster",
0 commit comments