Skip to content

Commit

Permalink
adds support for deleting init node (machine) for rke2/k3s clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Diamond committed Apr 3, 2024
1 parent 28c4de3 commit 635bc7f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions extensions/nodes/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const (
local = "local"
machinePlanSecretType = "rke.cattle.io/machine-plan"
machineNameSteveLabel = "rke.cattle.io/machine-name"
True = "true"
)

// GetInitMachine accepts a client and clusterID and returns the "init node" machine
Expand All @@ -43,8 +42,8 @@ func GetInitMachine(client *rancher.Client, clusterID string) (*v1.SteveAPIObjec
logrus.Info("Identifying init node machine plan...")
for _, machinePlan := range machinePlans {
v, ok := machinePlan.ObjectMeta.Labels[initNodeLabelKey]
if ok && v == True {
logrus.Infof("Found init node machine plan: %s", machinePlan.Name)
if ok && v == "true" {

Check failure on line 45 in extensions/nodes/nodes.go

View workflow job for this annotation

GitHub Actions / verify-changes

File is not `goimports`-ed (goimports)
logrus.Infof("Found init node machine plan: %s", machinePlan.Name)
initNodeMachineName = machinePlan.Labels[machineNameSteveLabel]
}
}
Expand All @@ -55,7 +54,7 @@ func GetInitMachine(client *rancher.Client, clusterID string) (*v1.SteveAPIObjec
return nil, err
}

logrus.Infof("Successfully retrived machine: %s", initNodeMachineName)
logrus.Infof("Successfully retrieved machine: %s", initNodeMachineName)

return initMachine, nil
}
Expand Down

0 comments on commit 635bc7f

Please sign in to comment.