config: fix aws instance type validation (#2171)

This commit is contained in:
3u13r 2023-08-04 18:16:49 +02:00 committed by GitHub
parent 15bb9588d7
commit 4564017b13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -782,7 +782,15 @@ func (c *Config) validateNodeGroupZoneField(fl validator.FieldLevel) bool {
}
func (c *Config) validateInstanceType(fl validator.FieldLevel) bool {
acceptNonCVM := c.GetAttestationConfig().GetVariant().Equal(variant.AzureTrustedLaunch{})
acceptNonCVM := false
if c.GetAttestationConfig().GetVariant().Equal(variant.AzureTrustedLaunch{}) {
acceptNonCVM = true
}
if c.GetAttestationConfig().GetVariant().Equal(variant.AWSNitroTPM{}) {
acceptNonCVM = true
}
return validInstanceTypeForProvider(fl.Field().String(), acceptNonCVM, c.GetProvider())
}