Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup logging for reconcile cluster #17282

Merged
merged 1 commit into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading