Skip to content

Commit

Permalink
Merge pull request #17284 from rifelpet/automated-cherry-pick-of-#172…
Browse files Browse the repository at this point in the history
…82-origin-release-1.32

Automated cherry pick of #17282: Cleanup logging for reconcile cluster
  • Loading branch information
k8s-ci-robot authored Feb 24, 2025
2 parents b41169d + bc2200d commit f2729b4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cmd/kops/reconcile_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func RunReconcileCluster(ctx context.Context, f *util.Factory, out io.Writer, c
}
}

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

fmt.Fprintf(out, "Doing rolling-update for nodes\n")
fmt.Fprintf(out, "Performing rolling-update for nodes\n")
{
opt := &RollingUpdateOptions{}
opt.InitDefaults()
Expand Down
1 change: 0 additions & 1 deletion cmd/kops/rolling-update_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,6 @@ func RunRollingUpdateCluster(ctx context.Context, f *util.Factory, out io.Writer
countByRole[instanceGroup.Spec.Role] = countByRole[instanceGroup.Spec.Role] + minSize
}
if countByRole[kopsapi.InstanceGroupRoleAPIServer]+countByRole[kopsapi.InstanceGroupRoleControlPlane] <= 1 {
fmt.Fprintf(out, "Detected single-control-plane cluster; won't detach before draining\n")
options.DeregisterControlPlaneNodes = false
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/kops/update_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ func RunUpdateCluster(ctx context.Context, f *util.Factory, out io.Writer, c *Up
fmt.Fprintf(sb, "\n")
}

if !firstRun {
if !firstRun && !c.Reconcile {
// TODO: Detect if rolling-update is needed
fmt.Fprintf(sb, "\n")
fmt.Fprintf(sb, "Changes may require instances to restart: kops rolling-update cluster\n")
Expand Down
5 changes: 4 additions & 1 deletion pkg/instancegroups/rollingupdate.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import (
"context"
stderrors "errors"
"fmt"
"maps"
"slices"
"sort"
"sync"
"time"
Expand Down Expand Up @@ -230,7 +232,8 @@ func (c *RollingUpdateCluster) RollingUpdate(ctx context.Context, groups map[str
}
}

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

Expand Down

0 comments on commit f2729b4

Please sign in to comment.