mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-19 17:59:05 -05:00
terraform-bundle: return an error if "versions" argument is omitted (#28158)
This commit is contained in:
@@ -72,11 +72,15 @@ func (c *Config) validate() error {
|
|||||||
return fmt.Errorf("providers.%s: %s", k, diags.Err().Error())
|
return fmt.Errorf("providers.%s: %s", k, diags.Err().Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if len(cs.Versions) > 0 {
|
||||||
for _, c := range cs.Versions {
|
for _, c := range cs.Versions {
|
||||||
if _, err := getproviders.ParseVersionConstraints(c); err != nil {
|
if _, err := getproviders.ParseVersionConstraints(c); err != nil {
|
||||||
return fmt.Errorf("providers.%s: %s", k, err)
|
return fmt.Errorf("providers.%s: %s", k, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return fmt.Errorf("provider.%s: required \"versions\" argument not found", k)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user