Skip to content
This repository was archived by the owner on Sep 30, 2020. It is now read-only.

Commit 639829c

Browse files
authored
Merge pull request #179 from mumoshu/more-validation-for-spot-fleet
Add missing validations for a node pool powered by Spot Fleet
2 parents 66d25c0 + c5acda3 commit 639829c

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

config/config.go

+8
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,14 @@ func (c WorkerDeploymentSettings) Valid() error {
11051105
return fmt.Errorf("number of user provided security groups must be less than or equal to 4 but was %d (actual EC2 limit is 5 but one of them is reserved for kube-aws) : %v", numSGs, sgRefs)
11061106
}
11071107

1108+
if c.SpotFleet.Enabled() && c.Experimental.AwsEnvironment.Enabled {
1109+
return fmt.Errorf("The experimental feature `awsEnvironment` assumes a node pool is managed by an ASG rather than a Spot Fleet.")
1110+
}
1111+
1112+
if c.SpotFleet.Enabled() && c.Experimental.WaitSignal.Enabled {
1113+
return fmt.Errorf("The experimental feature `waitSignal` assumes a node pool is managed by an ASG rather than a Spot Fleet.")
1114+
}
1115+
11081116
return nil
11091117
}
11101118

nodepool/config/config_test.go

+24
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,30 @@ vpcId: vpc-1a2b3c4d
466466
vpcCIDR: "10.1.0.0/16"
467467
`,
468468
},
469+
{
470+
context: "WithSpotFleetWithExperimentalAwsEnvironment",
471+
configYaml: minimalValidConfigYaml + `
472+
worker:
473+
spotFleet:
474+
targetCapacity: 10
475+
experimental:
476+
awsEnvironment:
477+
enabled: true
478+
`,
479+
expectedErrorMessage: "The experimental feature `awsEnvironment` assumes a node pool is managed by an ASG rather than a Spot Fleet.",
480+
},
481+
{
482+
context: "WithSpotFleetWithExperimentalWaitSignal",
483+
configYaml: minimalValidConfigYaml + `
484+
worker:
485+
spotFleet:
486+
targetCapacity: 10
487+
experimental:
488+
waitSignal:
489+
enabled: true
490+
`,
491+
expectedErrorMessage: "The experimental feature `waitSignal` assumes a node pool is managed by an ASG rather than a Spot Fleet.",
492+
},
469493
{
470494
context: "WithSpotFleetWithInvalidRootVolumeType",
471495
configYaml: minimalValidConfigYaml + `

0 commit comments

Comments
 (0)