terraform-bundle: return an error if "versions" argument is omitted (#28158)
This commit is contained in:
parent
683422e54f
commit
125e9d69d4
|
@ -72,11 +72,15 @@ func (c *Config) validate() error {
|
|||
return fmt.Errorf("providers.%s: %s", k, diags.Err().Error())
|
||||
}
|
||||
}
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue