Skip to content

Commit 5becdbf

Browse files
authored
Merge pull request #17282 from rifelpet/reconcile-logging
Cleanup logging for reconcile cluster
2 parents 3823fe7 + 5ac11aa commit 5becdbf

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

cmd/kops/reconcile_cluster.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ func RunReconcileCluster(ctx context.Context, f *util.Factory, out io.Writer, c
166166
}
167167
}
168168

169-
fmt.Fprintf(out, "Doing rolling-update for control plane\n")
169+
fmt.Fprintf(out, "Performing rolling-update for control plane\n")
170170
{
171171
opt := &RollingUpdateOptions{}
172172
opt.InitDefaults()
@@ -192,7 +192,7 @@ func RunReconcileCluster(ctx context.Context, f *util.Factory, out io.Writer, c
192192
}
193193
}
194194

195-
fmt.Fprintf(out, "Doing rolling-update for nodes\n")
195+
fmt.Fprintf(out, "Performing rolling-update for nodes\n")
196196
{
197197
opt := &RollingUpdateOptions{}
198198
opt.InitDefaults()

cmd/kops/rolling-update_cluster.go

-1
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ func RunRollingUpdateCluster(ctx context.Context, f *util.Factory, out io.Writer
285285
countByRole[instanceGroup.Spec.Role] = countByRole[instanceGroup.Spec.Role] + minSize
286286
}
287287
if countByRole[kopsapi.InstanceGroupRoleAPIServer]+countByRole[kopsapi.InstanceGroupRoleControlPlane] <= 1 {
288-
fmt.Fprintf(out, "Detected single-control-plane cluster; won't detach before draining\n")
289288
options.DeregisterControlPlaneNodes = false
290289
}
291290

cmd/kops/update_cluster.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ func RunUpdateCluster(ctx context.Context, f *util.Factory, out io.Writer, c *Up
478478
fmt.Fprintf(sb, "\n")
479479
}
480480

481-
if !firstRun {
481+
if !firstRun && !c.Reconcile {
482482
// TODO: Detect if rolling-update is needed
483483
fmt.Fprintf(sb, "\n")
484484
fmt.Fprintf(sb, "Changes may require instances to restart: kops rolling-update cluster\n")

pkg/instancegroups/rollingupdate.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import (
2020
"context"
2121
stderrors "errors"
2222
"fmt"
23+
"maps"
24+
"slices"
2325
"sort"
2426
"sync"
2527
"time"
@@ -230,7 +232,8 @@ func (c *RollingUpdateCluster) RollingUpdate(ctx context.Context, groups map[str
230232
}
231233
}
232234

233-
klog.Infof("Rolling update completed for cluster %q!", c.ClusterName)
235+
igNames := slices.Sorted(maps.Keys(groups))
236+
klog.Infof("Completed rolling update for cluster %q instance groups %v", c.ClusterName, igNames)
234237
return errors.NewAggregate(errs)
235238
}
236239

0 commit comments

Comments
 (0)