@@ -111,8 +111,10 @@ var UserValidation = &cr.StructValidation{
111111 },
112112 },
113113 {
114- StructField : "Spot" ,
115- BoolPtrValidation : & cr.BoolPtrValidation {},
114+ StructField : "Spot" ,
115+ BoolPtrValidation : & cr.BoolPtrValidation {
116+ Default : pointer .Bool (false ),
117+ },
116118 },
117119 {
118120 StructField : "SpotConfig" ,
@@ -562,17 +564,6 @@ func InstallPrompt(clusterConfig *ClusterConfig, awsAccessKeyID string, awsSecre
562564 Default : defaultBucket ,
563565 },
564566 },
565- {
566- StructField : "Spot" ,
567- PromptOpts : & prompt.Options {
568- Prompt : "use spot instances (y/n)" ,
569- DefaultStr : "y" ,
570- },
571- BoolPtrValidation : & cr.BoolPtrValidation {
572- Required : true ,
573- StrToBool : map [string ]bool {"y" : true , "n" : false },
574- },
575- },
576567 {
577568 StructField : "InstanceType" ,
578569 PromptOpts : & prompt.Options {
@@ -717,13 +708,13 @@ func (cc *ClusterConfig) UserFacingTable() []table.KV {
717708 items = append (items , table.KV {K : ClusterNameUserFacingKey , V : cc .ClusterName })
718709 items = append (items , table.KV {K : RegionUserFacingKey , V : * cc .Region })
719710 items = append (items , table.KV {K : BucketUserFacingKey , V : * cc .Bucket })
720- items = append (items , table.KV {K : SpotUserFacingKey , V : s .YesNo (* cc .Spot )})
721711 items = append (items , table.KV {K : InstanceTypeUserFacingKey , V : * cc .InstanceType })
722712 items = append (items , table.KV {K : MinInstancesUserFacingKey , V : * cc .MinInstances })
723713 items = append (items , table.KV {K : MaxInstancesUserFacingKey , V : * cc .MaxInstances })
724714 items = append (items , table.KV {K : InstanceVolumeSizeUserFacingKey , V : cc .InstanceVolumeSize })
715+ items = append (items , table.KV {K : SpotUserFacingKey , V : s .YesNo (* cc .Spot )})
725716
726- if cc .Spot != nil {
717+ if cc .Spot != nil && * cc . Spot {
727718 items = append (items , table.KV {K : InstanceDistributionUserFacingKey , V : cc .SpotConfig .InstanceDistribution })
728719 items = append (items , table.KV {K : OnDemandBaseCapacityUserFacingKey , V : * cc .SpotConfig .OnDemandBaseCapacity })
729720 items = append (items , table.KV {K : OnDemandPercentageAboveBaseCapacityUserFacingKey , V : * cc .SpotConfig .OnDemandPercentageAboveBaseCapacity })
0 commit comments