Skip to content

Commit f0e04ab

Browse files
committed
merge fix
1 parent 8c9c6cd commit f0e04ab

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

cmd/terraform.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,13 @@ func addTerraformCommandConfig() {
103103
Description: "Skip executing specific YAML functions in the Atmos stack manifests when executing terraform commands",
104104
DefaultValue: []string{},
105105
})
106-
106+
config.DefaultConfigHandler.AddConfig(terraformCmd, cfg.ConfigOptions{
107+
Key: "components.terraform.init.pass_vars",
108+
FlagName: "init-pass-vars",
109+
EnvVar: "ATMOS_COMPONENTS_TERRAFORM_INIT_PASS_VARS",
110+
Description: "Pass the generated varfile to `terraform init` using the `--var-file` flag. [OpenTofu supports passing a varfile to `init`](https://opentofu.org/docs/cli/commands/init/#general-options) to dynamically configure backends",
111+
DefaultValue: false,
112+
})
107113
}
108114

109115
func runHooks(event h.HookEvent, cmd *cobra.Command, args []string) error {

pkg/config/config_new.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ func (c *ConfigHandler) AddConfig(cmd *cobra.Command, opts ConfigOptions) error
7777
// Handle environment variable binding
7878
if opts.EnvVar != "" {
7979
if err := c.v.BindEnv(key, opts.EnvVar); err != nil {
80-
return fmt.Errorf("failed to bind custom env var %s for %s: %w", opts.EnvVar, key, err)
80+
panic(err)
8181
}
8282
} else {
8383
if err := c.v.BindEnv(key); err != nil {
84-
return fmt.Errorf("failed to bind default env var for %s: %w", key, err)
84+
panic(err)
8585
}
8686
}
8787

0 commit comments

Comments
 (0)