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

reconcile: if --yes is not provided, print the same output as update cluster does #17214

Merged
Merged
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
12 changes: 9 additions & 3 deletions cmd/kops/reconcile_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,19 @@ func NewCmdReconcileCluster(f *util.Factory, out io.Writer) *cobra.Command {
// "update" is probably now smart enough to automatically not update the control plane if it is already at the desired version,
// but we do it explicitly here to be clearer / safer.
func RunReconcileCluster(ctx context.Context, f *util.Factory, out io.Writer, c *CoreUpdateClusterOptions) error {
if !c.Yes {
return fmt.Errorf("reconcile is only supported with --yes")
}
if c.Target == cloudup.TargetTerraform {
return fmt.Errorf("reconcile is not supported with terraform")
}

if !c.Yes {
// A reconcile without --yes is the same as a dry run
opt := *c
if _, err := RunCoreUpdateCluster(ctx, f, out, &opt); err != nil {
return err
}
return nil
}

fmt.Fprintf(out, "Updating control plane configuration\n")
{
opt := *c
Expand Down
Loading