Skip to content

Commit

Permalink
Check version sources based on whether verison has been set
Browse files Browse the repository at this point in the history
Update logic for reading sources for obtaining version to read from next source explicitly if version has not been set.
This handles situations where a source exists (e.g. TOML file, terraform files), but a version constraint cannot be found from the source.
This avoids duplicate checks for existance of sources (such as Terragrunt file), as this was performed in GetParamters and also in the methods to read the config from the source.

Issue #420
  • Loading branch information
MatthewJohn committed May 9, 2024
1 parent e8d0167 commit c14a06e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions lib/param_parsing/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,20 @@ func GetParameters() Params {
// Read configuration files
if tomlFileExists(params) {
params, err = getParamsTOML(params)
} else if tfSwitchFileExists(params) {
}
if params.Version == "" {
params, err = GetParamsFromTfSwitch(params)
} else if terraformVersionFileExists(params) {
}
if params.Version == "" {
params, err = GetParamsFromTerraformVersion(params)
} else if isTerraformModule(params) {
}
if params.Version == "" {
params, err = GetVersionFromVersionsTF(params)
} else if terraGruntFileExists(params) {
}
if params.Version == "" {
params, err = GetVersionFromTerragrunt(params)
} else {
}
if params.Version == "" {
params = GetParamsFromEnvironment(params)
}
if err != nil {
Expand Down

0 comments on commit c14a06e

Please sign in to comment.