Skip to content

Commit

Permalink
fix: Ignore mixedInstancePolicy if type is LaunchConfig (#303)
Browse files Browse the repository at this point in the history
* Ignore mixedInstancePolicy if type is LaunchConfig

Signed-off-by: Eytan Avisror <[email protected]>

* Update instancegroup_types.go

Signed-off-by: Eytan Avisror <[email protected]>

* add ig name to log entries

Signed-off-by: Eytan Avisror <[email protected]>

* Update instancegroup_types.go

Signed-off-by: Eytan Avisror <[email protected]>

* Update instancegroup_types.go

Signed-off-by: Eytan Avisror <[email protected]>
  • Loading branch information
eytan-avisror authored May 12, 2021
1 parent a1ee5ca commit 345ef0c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion api/v1alpha1/instancegroup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,11 @@ func (s *EKSSpec) Validate() error {
s.Type = LaunchConfiguration
}

if s.Type == LaunchConfiguration {
// always ignore mixedInstancesPolicy in case of LaunchConfiguration
s.EKSConfiguration.MixedInstancesPolicy = nil
}

if s.IsLaunchConfiguration() {
if !common.SliceEmpty(s.EKSConfiguration.LicenseSpecifications) {
return errors.Errorf("validation failed, field 'licenseSpecifications' is only valid for LaunchTemplates")
Expand Down Expand Up @@ -532,7 +537,7 @@ func (c *EKSConfiguration) Validate() error {
for _, v := range c.Volumes {

if v.Iops != 0 && !common.ContainsEqualFold(awsprovider.AllowedVolumeTypesWithProvisionedIOPS, v.Type) {
log.Info("cannot apply IOPS configuration for volumeType, only types ['io1','io2','gp3'] supported", "volumeType", v.Type)
return errors.Errorf("cannot apply IOPS configuration for volumeType '%v', only types '%v' supported", v.Type, awsprovider.AllowedVolumeTypesWithProvisionedIOPS)
}

if v.SnapshotID != "" {
Expand Down

0 comments on commit 345ef0c

Please sign in to comment.