Skip to content

Commit

Permalink
Add comment and small fix
Browse files Browse the repository at this point in the history
Signed-off-by: nasusoba <[email protected]>

slightly fixed the comment

Signed-off-by: nasusoba <[email protected]>
  • Loading branch information
nasusoba committed May 6, 2024
1 parent c05fb3f commit 18e434b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion pkg/k3s/workload_cluster_etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ func (w *Workload) reconcileEtcdMember(ctx context.Context, nodeNames []string,
loopmembers:
for _, member := range members {
curNodeName := etcdutil.NodeNameFromMember(member)
// If this member is just added, it has a empty name until the etcd starts. Ignore it.
if curNodeName == "" {
continue
}

for _, nodeName := range nodeNames {
if curNodeName == nodeName {
Expand All @@ -95,7 +99,7 @@ loopmembers:
return removedMembers, errs
}

// RemoveEtcdMemberForMachine removes the etcd member from the target cluster's etcd cluster.
// RemoveEtcdMemberForMachine removes the etcd member from the target cluster's etcd cluster, and returns true if the member has been removed.
// Removing the last remaining member of the cluster is not supported.
func (w *Workload) RemoveEtcdMemberForMachine(ctx context.Context, machine *clusterv1.Machine) (bool, error) {
if machine == nil || machine.Status.NodeRef == nil {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/node_scale_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ var _ = Describe("Workload cluster scaling", func() {
Namespace: namespace.Name,
ClusterName: clusterName,
KubernetesVersion: e2eConfig.GetVariable(KubernetesVersion),
ControlPlaneMachineCount: pointer.Int64Ptr(3), // TODO: change to 1 after scaling down control planes working
ControlPlaneMachineCount: pointer.Int64Ptr(1),
WorkerMachineCount: pointer.Int64Ptr(1),
},
WaitForClusterIntervals: e2eConfig.GetIntervals(specName, "wait-cluster"),
Expand Down

0 comments on commit 18e434b

Please sign in to comment.