Skip to content

Commit 7cb02e8

Browse files
authored
Merge pull request #17285 from rifelpet/automated-cherry-pick-of-#17282-origin-release-1.31
Automated cherry pick of #17282: Cleanup logging for reconcile cluster
2 parents 14c9281 + 4869a6c commit 7cb02e8

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
@@ -140,7 +140,7 @@ func RunReconcileCluster(ctx context.Context, f *util.Factory, out io.Writer, c
140140
}
141141
}
142142

143-
fmt.Fprintf(out, "Doing rolling-update for control plane\n")
143+
fmt.Fprintf(out, "Performing rolling-update for control plane\n")
144144
{
145145
opt := &RollingUpdateOptions{}
146146
opt.InitDefaults()
@@ -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 nodes\n")
169+
fmt.Fprintf(out, "Performing rolling-update for nodes\n")
170170
{
171171
opt := &RollingUpdateOptions{}
172172
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
@@ -475,7 +475,7 @@ func RunUpdateCluster(ctx context.Context, f *util.Factory, out io.Writer, c *Up
475475
fmt.Fprintf(sb, "\n")
476476
}
477477

478-
if !firstRun {
478+
if !firstRun && !c.Reconcile {
479479
// TODO: Detect if rolling-update is needed
480480
fmt.Fprintf(sb, "\n")
481481
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)