From 48f12bed83b64e28ca18c4b070523eb0df46f524 Mon Sep 17 00:00:00 2001 From: justinsb Date: Wed, 15 Jan 2025 06:18:26 -0500 Subject: [PATCH] reconcile: if --yes is not provided, print the same output as `update cluster` does --- cmd/kops/reconcile_cluster.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/cmd/kops/reconcile_cluster.go b/cmd/kops/reconcile_cluster.go index 7ec9db74450a5..8550798a6f052 100644 --- a/cmd/kops/reconcile_cluster.go +++ b/cmd/kops/reconcile_cluster.go @@ -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