Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions cli/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ func TestParseTerragruntOptionsFromArgs(t *testing.T) {
t.Skip("Skipping test on Windows")
}

terragruntPrefix := flags.Prefix{flags.TerragruntPrefix}

workingDir, err := os.Getwd()
if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -79,7 +77,7 @@ func TestParseTerragruntOptionsFromArgs(t *testing.T) {
},

{
args: []string{"apply", doubleDashed(terragruntPrefix.FlagName("include-external-dependencies"))},
args: []string{"apply", doubleDashed(run.QueueIncludeExternalFlagName)},
expectedOptions: mockOptions(t, util.JoinPath(workingDir, config.DefaultTerragruntConfigPath), workingDir, []string{"apply"}, false, "", false, true, defaultLogLevel, false),
},

Expand Down Expand Up @@ -109,12 +107,12 @@ func TestParseTerragruntOptionsFromArgs(t *testing.T) {
},

{
args: []string{"plan", doubleDashed(terragruntPrefix.FlagName("ignore-external-dependencies"))},
args: []string{"plan", doubleDashed(run.QueueExcludeExternalFlagName)},
expectedOptions: mockOptions(t, util.JoinPath(workingDir, config.DefaultTerragruntConfigPath), workingDir, []string{"plan"}, false, "", false, false, defaultLogLevel, false),
},

{
args: []string{"plan", doubleDashed(terragruntPrefix.FlagName("iam-role")), "arn:aws:iam::ACCOUNT_ID:role/ROLE_NAME"},
args: []string{"plan", doubleDashed(run.IAMAssumeRoleFlagName), "arn:aws:iam::ACCOUNT_ID:role/ROLE_NAME"},
expectedOptions: mockOptionsWithIamRole(t, util.JoinPath(workingDir, config.DefaultTerragruntConfigPath), workingDir, []string{"plan"}, false, "", false, "arn:aws:iam::ACCOUNT_ID:role/ROLE_NAME"),
},

Expand All @@ -129,7 +127,7 @@ func TestParseTerragruntOptionsFromArgs(t *testing.T) {
},

{
args: []string{"plan", doubleDashed(terragruntPrefix.FlagName("iam-web-identity-token")), "web-identity-token"},
args: []string{"plan", doubleDashed(run.IAMAssumeRoleWebIdentityTokenFlagName), "web-identity-token"},
expectedOptions: mockOptionsWithIamWebIdentityToken(t, util.JoinPath(workingDir, config.DefaultTerragruntConfigPath), workingDir, []string{"plan"}, false, "", false, "web-identity-token"),
},

Expand Down Expand Up @@ -382,9 +380,7 @@ func TestParseMultiStringArg(t *testing.T) {
func TestParseMutliStringKeyValueArg(t *testing.T) {
t.Parallel()

terragruntPrefix := flags.Prefix{flags.TerragruntPrefix}

flagName := doubleDashed(terragruntPrefix.FlagName(awsproviderpatch.OverrideAttrFlagName))
flagName := doubleDashed(awsproviderpatch.OverrideAttrFlagName)

testCases := []struct {
expectedErr error
Expand Down
2 changes: 1 addition & 1 deletion cli/commands/aws-provider-patch/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func NewFlags(l log.Logger, opts *options.TerragruntOptions, prefix flags.Prefix
Destination: &opts.AwsProviderPatchOverrides,
Usage: "A key=value attribute to override in a provider block as part of the aws-provider-patch command. May be specified multiple times.",
},
flags.WithDeprecatedName(terragruntPrefix.FlagName("override-attr"), terragruntPrefixControl)),
flags.WithDeprecatedEnvVars(terragruntPrefix.EnvVars("override-attr"), terragruntPrefixControl)),
}
}

Expand Down
10 changes: 5 additions & 5 deletions cli/commands/hcl/format/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func NewFlags(opts *options.TerragruntOptions, prefix flags.Prefix) cli.Flags {
Usage: "The path to a single HCL file that the command should run on.",
},
flags.WithDeprecatedEnvVars(tgPrefix.EnvVars("hclfmt-file"), terragruntPrefixControl), // `TG_HCLFMT_FILE`
flags.WithDeprecatedNames(terragruntPrefix.FlagNames("hclfmt-file"), terragruntPrefixControl), // `--terragrunt-hclfmt-file`, `TERRAGRUNT_HCLFMT_FILE`
flags.WithDeprecatedEnvVars(terragruntPrefix.EnvVars("hclfmt-file"), terragruntPrefixControl), // `TERRAGRUNT_HCLFMT_FILE`
),

flags.NewFlag(&cli.SliceFlag[string]{
Expand All @@ -43,7 +43,7 @@ func NewFlags(opts *options.TerragruntOptions, prefix flags.Prefix) cli.Flags {
Usage: "Skip HCL formatting in given directories.",
},
flags.WithDeprecatedEnvVars(tgPrefix.EnvVars("hclfmt-exclude-dir"), terragruntPrefixControl), // `TG_HCLFMT_EXCLUDE_DIR`
flags.WithDeprecatedNames(terragruntPrefix.FlagNames("hclfmt-exclude-dir"), terragruntPrefixControl), // `--terragrunt-hclfmt-exclude-dir`, `TERRAGRUNT_EXCLUDE_DIR`
flags.WithDeprecatedEnvVars(terragruntPrefix.EnvVars("hclfmt-exclude-dir"), terragruntPrefixControl), // `TERRAGRUNT_EXCLUDE_DIR`
),

flags.NewFlag(&cli.BoolFlag{
Expand All @@ -53,7 +53,7 @@ func NewFlags(opts *options.TerragruntOptions, prefix flags.Prefix) cli.Flags {
Usage: "Return a status code of zero when all files are formatted correctly, and a status code of one when they aren't.",
},
flags.WithDeprecatedEnvVars(tgPrefix.EnvVars("hclfmt-check"), terragruntPrefixControl), // `TG_HCLFMT_CHECK`
flags.WithDeprecatedNames(terragruntPrefix.FlagNames("check"), terragruntPrefixControl), // `--terragrunt-check`, `TERRAGRUNT_CHECK`
flags.WithDeprecatedEnvVars(terragruntPrefix.EnvVars("check"), terragruntPrefixControl), // `TERRAGRUNT_CHECK`
),

flags.NewFlag(&cli.BoolFlag{
Expand All @@ -63,7 +63,7 @@ func NewFlags(opts *options.TerragruntOptions, prefix flags.Prefix) cli.Flags {
Usage: "Print diff between original and modified file versions.",
},
flags.WithDeprecatedEnvVars(tgPrefix.EnvVars("hclfmt-diff"), terragruntPrefixControl), // `TG_HCLFMT_DIFF`
flags.WithDeprecatedNames(terragruntPrefix.FlagNames("diff"), terragruntPrefixControl), // `--terragrunt-diff`, `TERRAGRUNT_DIFF`
flags.WithDeprecatedEnvVars(terragruntPrefix.EnvVars("diff"), terragruntPrefixControl), // `TERRAGRUNT_DIFF`
),

flags.NewFlag(&cli.BoolFlag{
Expand All @@ -73,7 +73,7 @@ func NewFlags(opts *options.TerragruntOptions, prefix flags.Prefix) cli.Flags {
Usage: "Format HCL from stdin and print result to stdout.",
},
flags.WithDeprecatedEnvVars(tgPrefix.EnvVars("hclfmt-stdin"), terragruntPrefixControl), // `TG_HCLFMT_STDIN`
flags.WithDeprecatedNames(terragruntPrefix.FlagNames("hclfmt-stdin"), terragruntPrefixControl), // `--terragrunt-hclfmt-stdin`, `TERRAGRUNT_HCLFMT_STDIN`
flags.WithDeprecatedEnvVars(terragruntPrefix.EnvVars("hclfmt-stdin"), terragruntPrefixControl), // `TERRAGRUNT_HCLFMT_STDIN`
),
}

Expand Down
7 changes: 3 additions & 4 deletions cli/commands/hcl/validate/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ func NewFlags(opts *options.TerragruntOptions, prefix flags.Prefix) cli.Flags {
Destination: &opts.HCLValidateStrict,
Usage: "Enables strict mode. When used in combination with the `--inputs` flag, any inputs defined in Terragrunt that are _not_ used in OpenTofu/Terraform will trigger an error.",
},
flags.WithDeprecatedFlagName("strict-validate", terragruntPrefixControl), // `--strict-validate`
flags.WithDeprecatedEnvVars(tgPrefix.EnvVars(
"strict-validate", // `TG_STRICT_VALIDATE`
"hclvalidate-strict-validate", // `TG_HCLVALIDATE_STRICT_VALIDATE`
), terragruntPrefixControl),
flags.WithDeprecatedNames(terragruntPrefix.FlagNames("strict-validate"), terragruntPrefixControl), // `--terragrunt-strict-validate`, `TERRAGRUNT_STRICT_VALIDATE`
flags.WithDeprecatedEnvVars(terragruntPrefix.EnvVars("strict-validate"), terragruntPrefixControl), // `TERRAGRUNT_STRICT_VALIDATE`
),

flags.NewFlag(&cli.BoolFlag{
Expand All @@ -53,7 +52,7 @@ func NewFlags(opts *options.TerragruntOptions, prefix flags.Prefix) cli.Flags {
},

flags.WithDeprecatedEnvVars(tgPrefix.EnvVars("hclvalidate-strict-validate"), terragruntPrefixControl), // `TG_HCLVALIDATE_STRICT_VALIDATE`
flags.WithDeprecatedNames(terragruntPrefix.FlagNames("hclvalidate-show-config-path"), terragruntPrefixControl), // `--terragrunt-hclvalidate-show-config-path`, `TERRAGRUNT_HCLVALIDATE_SHOW_CONFIG_PATH`
flags.WithDeprecatedEnvVars(terragruntPrefix.EnvVars("hclvalidate-show-config-path"), terragruntPrefixControl), // `TERRAGRUNT_HCLVALIDATE_SHOW_CONFIG_PATH`
),

flags.NewFlag(&cli.BoolFlag{
Expand All @@ -63,7 +62,7 @@ func NewFlags(opts *options.TerragruntOptions, prefix flags.Prefix) cli.Flags {
Usage: "Format results in JSON format.",
},
flags.WithDeprecatedEnvVars(tgPrefix.EnvVars("hclvalidate-json"), terragruntPrefixControl), // `TG_HCLVALIDATE_JSON`
flags.WithDeprecatedNames(terragruntPrefix.FlagNames("hclvalidate-json"), terragruntPrefixControl), // `--terragrunt-hclvalidate-json`, `TERRAGRUNT_HCLVALIDATE_JSON`
flags.WithDeprecatedEnvVars(terragruntPrefix.EnvVars("hclvalidate-json"), terragruntPrefixControl), // `TERRAGRUNT_HCLVALIDATE_JSON`
),
}

Expand Down
8 changes: 4 additions & 4 deletions cli/commands/render/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ func NewFlags(opts *Options, prefix flags.Prefix) cli.Flags {
Destination: &opts.OutputPath,
Usage: "The file name that terragrunt should use when rendering the terragrunt.hcl config (next to the unit configuration).",
},
flags.WithDeprecatedFlagName("json-out", terragruntPrefixControl), // `--json-out`
flags.WithDeprecatedFlagName("json-out", terragruntPrefixControl), // `--json-out` (deprecated: use `--out` instead)
flags.WithDeprecatedEnvVars(tgPrefix.EnvVars("render-json-out"), terragruntPrefixControl), // `TG_RENDER_JSON_OUT`
flags.WithDeprecatedNames(terragruntPrefix.FlagNames("json-out"), terragruntPrefixControl), // `--terragrunt-json-out`, `TERRAGRUNT_JSON_OUT`
flags.WithDeprecatedEnvVars(terragruntPrefix.EnvVars("json-out"), terragruntPrefixControl), // `TERRAGRUNT_JSON_OUT`
),

flags.NewFlag(&cli.BoolFlag{
Expand All @@ -97,7 +97,7 @@ func NewFlags(opts *Options, prefix flags.Prefix) cli.Flags {
Usage: "Add metadata to the rendered output file.",
},
flags.WithDeprecatedEnvVars(tgPrefix.EnvVars("render-json-with-metadata"), terragruntPrefixControl), // `TG_RENDER_JSON_WITH_METADATA`
flags.WithDeprecatedNames(terragruntPrefix.FlagNames("with-metadata"), terragruntPrefixControl), // `--terragrunt-with-metadata`, `TERRAGRUNT_WITH_METADATA`
flags.WithDeprecatedEnvVars(terragruntPrefix.EnvVars("with-metadata"), terragruntPrefixControl), // `TERRAGRUNT_WITH_METADATA`
),

flags.NewFlag(&cli.BoolFlag{
Expand All @@ -107,7 +107,7 @@ func NewFlags(opts *Options, prefix flags.Prefix) cli.Flags {
Usage: "Disable identification of dependent modules when rendering config.",
},
flags.WithDeprecatedEnvVars(tgPrefix.EnvVars("render-json-disable-dependent-modules"), terragruntPrefixControl), // `TG_RENDER_JSON_DISABLE_DEPENDENT_MODULES`
flags.WithDeprecatedNames(terragruntPrefix.FlagNames("json-disable-dependent-modules"), terragruntPrefixControl), // `--terragrunt-json-disable-dependent-modules`, `TERRAGRUNT_JSON_DISABLE_DEPENDENT_MODULES`
flags.WithDeprecatedEnvVars(terragruntPrefix.EnvVars("json-disable-dependent-modules"), terragruntPrefixControl), // `TERRAGRUNT_JSON_DISABLE_DEPENDENT_MODULES`
),
}
}
Expand Down
Loading
Loading