Skip to content

Commit abba640

Browse files
committed
Update spot instance pricing display logic
1 parent d798f32 commit abba640

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

cli/cmd/lib_cluster_config.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,8 @@ func confirmInstallClusterConfig(clusterConfig *clusterconfig.Config, awsCreds A
320320
isSpot := clusterConfig.Spot != nil && *clusterConfig.Spot
321321
if isSpot {
322322
spotPrice, err := awsClient.SpotInstancePrice(*clusterConfig.Region, *clusterConfig.InstanceType)
323-
if err == nil {
324-
workerPriceStr += " (spot pricing unavailable)"
325-
}
326-
if spotPrice != 0 {
323+
workerPriceStr += " (spot pricing unavailable)"
324+
if err == nil && spotPrice != 0 {
327325
workerPriceStr = fmt.Sprintf("%s - %s each (varies based on spot price)", s.DollarsMaxPrecision(spotPrice), s.DollarsMaxPrecision(apiInstancePrice))
328326
totalMinPrice = fixedPrice + float64(*clusterConfig.MinInstances)*(spotPrice+apiEBSPrice)
329327
}

0 commit comments

Comments
 (0)