terraform-bundle: return an error if "versions" argument is omitted (#28158)
This commit is contained in:
parent
683422e54f
commit
125e9d69d4
|
@ -72,10 +72,14 @@ func (c *Config) validate() error {
|
|||
return fmt.Errorf("providers.%s: %s", k, diags.Err().Error())
|
||||
}
|
||||
}
|
||||
for _, c := range cs.Versions {
|
||||
if _, err := getproviders.ParseVersionConstraints(c); err != nil {
|
||||
return fmt.Errorf("providers.%s: %s", k, err)
|
||||
if len(cs.Versions) > 0 {
|
||||
for _, c := range cs.Versions {
|
||||
if _, err := getproviders.ParseVersionConstraints(c); err != nil {
|
||||
return fmt.Errorf("providers.%s: %s", k, err)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return fmt.Errorf("provider.%s: required \"versions\" argument not found", k)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue