Skip to content

Commit e1cb7e2

Browse files
authored
Merge pull request #17223 from justinsb/automated-cherry-pick-of-#17214-release-1.31
Automated cherry pick of #17214: reconcile: if --yes is not provided, print the same output as `update cluster` does
2 parents 899bfb6 + 6f5a2b5 commit e1cb7e2

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

cmd/kops/reconcile_cluster.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,19 @@ func NewCmdReconcileCluster(f *util.Factory, out io.Writer) *cobra.Command {
114114
// "update" is probably now smart enough to automatically not update the control plane if it is already at the desired version,
115115
// but we do it explicitly here to be clearer / safer.
116116
func RunReconcileCluster(ctx context.Context, f *util.Factory, out io.Writer, c *CoreUpdateClusterOptions) error {
117-
if !c.Yes {
118-
return fmt.Errorf("reconcile is only supported with --yes")
119-
}
120117
if c.Target == cloudup.TargetTerraform {
121118
return fmt.Errorf("reconcile is not supported with terraform")
122119
}
123120

121+
if !c.Yes {
122+
// A reconcile without --yes is the same as a dry run
123+
opt := *c
124+
if _, err := RunCoreUpdateCluster(ctx, f, out, &opt); err != nil {
125+
return err
126+
}
127+
return nil
128+
}
129+
124130
fmt.Fprintf(out, "Updating control plane configuration\n")
125131
{
126132
opt := *c

0 commit comments

Comments
 (0)