mirror of https://github.com/kubernetes/kops.git
Cleanup logging for reconcile cluster
This commit is contained in:
parent
3823fe705a
commit
5ac11aa55a
|
@ -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 := &RollingUpdateOptions{}
|
||||||
opt.InitDefaults()
|
opt.InitDefaults()
|
||||||
|
@ -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 := &RollingUpdateOptions{}
|
||||||
opt.InitDefaults()
|
opt.InitDefaults()
|
||||||
|
|
|
@ -285,7 +285,6 @@ func RunRollingUpdateCluster(ctx context.Context, f *util.Factory, out io.Writer
|
||||||
countByRole[instanceGroup.Spec.Role] = countByRole[instanceGroup.Spec.Role] + minSize
|
countByRole[instanceGroup.Spec.Role] = countByRole[instanceGroup.Spec.Role] + minSize
|
||||||
}
|
}
|
||||||
if countByRole[kopsapi.InstanceGroupRoleAPIServer]+countByRole[kopsapi.InstanceGroupRoleControlPlane] <= 1 {
|
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
|
options.DeregisterControlPlaneNodes = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -478,7 +478,7 @@ func RunUpdateCluster(ctx context.Context, f *util.Factory, out io.Writer, c *Up
|
||||||
fmt.Fprintf(sb, "\n")
|
fmt.Fprintf(sb, "\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
if !firstRun {
|
if !firstRun && !c.Reconcile {
|
||||||
// TODO: Detect if rolling-update is needed
|
// TODO: Detect if rolling-update is needed
|
||||||
fmt.Fprintf(sb, "\n")
|
fmt.Fprintf(sb, "\n")
|
||||||
fmt.Fprintf(sb, "Changes may require instances to restart: kops rolling-update cluster\n")
|
fmt.Fprintf(sb, "Changes may require instances to restart: kops rolling-update cluster\n")
|
||||||
|
|
|
@ -20,6 +20,8 @@ import (
|
||||||
"context"
|
"context"
|
||||||
stderrors "errors"
|
stderrors "errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"maps"
|
||||||
|
"slices"
|
||||||
"sort"
|
"sort"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
@ -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)
|
return errors.NewAggregate(errs)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue