Skip to content

Commit b332626

Browse files
committed
Autofill spot when user specified spot is true
(cherry picked from commit 1f037cc)
1 parent 01bc431 commit b332626

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

cli/cmd/lib_cluster_config.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,6 @@ func getUpdateClusterConfig(cachedClusterConfig *clusterconfig.ClusterConfig, aw
8787
return nil, err
8888
}
8989

90-
err = userClusterConfig.AutoFillSpot()
91-
if err != nil {
92-
return nil, err
93-
}
94-
9590
userClusterConfig.ClusterName = cachedClusterConfig.ClusterName
9691
userClusterConfig.Region = cachedClusterConfig.Region
9792

@@ -114,6 +109,13 @@ func getUpdateClusterConfig(cachedClusterConfig *clusterconfig.ClusterConfig, aw
114109
}
115110
userClusterConfig.Spot = cachedClusterConfig.Spot
116111

112+
if userClusterConfig.Spot != nil && *userClusterConfig.Spot {
113+
err = userClusterConfig.AutoFillSpot()
114+
if err != nil {
115+
return nil, err
116+
}
117+
}
118+
117119
if userClusterConfig.SpotConfig != nil && s.Obj(userClusterConfig.SpotConfig) != s.Obj(cachedClusterConfig.SpotConfig) {
118120
if cachedClusterConfig.SpotConfig == nil {
119121
return nil, clusterconfig.ErrorConfiguredWhenSpotIsNotEnabled(clusterconfig.SpotConfigKey)

0 commit comments

Comments
 (0)