Skip to content

Commit

Permalink
OCM-9139 | fix: Enable maxSurge and maxUnavailable for interactive mode
Browse files Browse the repository at this point in the history
  • Loading branch information
philipwu08 committed Jul 11, 2024
1 parent 0579b2b commit 0e15183
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/create/machinepool/nodepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ func addNodePool(cmd *cobra.Command, clusterKey string, cluster *cmv1.Cluster, r

isMaxSurgeSet := cmd.Flags().Changed("max-surge")
isMaxUnavailableSet := cmd.Flags().Changed("max-unavailable")
if isMaxSurgeSet && isMaxUnavailableSet {
if isMaxSurgeSet || isMaxUnavailableSet || interactive.Enabled() {
maxSurge := args.maxSurge
if interactive.Enabled() {
maxSurge, err = interactive.GetString(interactive.Input{
Expand Down
2 changes: 1 addition & 1 deletion pkg/machinepool/machinepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ func editNodePool(cmd *cobra.Command, nodePoolID string,
}
}

if isUpgradeMaxSurgeSet && isUpgradeMaxUnavailableSet {
if isUpgradeMaxSurgeSet || isUpgradeMaxUnavailableSet || interactive.Enabled() {
maxSurge := cmd.Flags().Lookup("max-surge").Value.String()
if maxSurge == "" && nodePool.ManagementUpgrade().MaxSurge() != "" {
maxSurge = nodePool.ManagementUpgrade().MaxSurge()
Expand Down

0 comments on commit 0e15183

Please sign in to comment.