atmos icon indicating copy to clipboard operation
atmos copied to clipboard

Add ability to allow atmos to run init with the `upgrade` flag

Open zack-is-cool opened this issue 6 months ago • 1 comments

Describe the Feature

When working with atmos, I had updated one of my local modules provider versions and I needed to run an init with the upgrade option. It appears that there is no ability to have atmos run the upgrade flag for me similar to init_run_reconfigure

Expected Behavior

add init_run_upgrade or similar to atmos.yaml - or somehow have atmos detect when an upgrade is needed and run it for me.

Use Case

Getting this error when trying to run atmos terraform apply and no way to tell atmos to run it for me via cli options similar to init_run_reconfigure

â•·
│ Error: Failed to resolve provider packages
│ 
│ Could not resolve provider gitlabhq/gitlab: locked provider registry.opentofu.org/gitlabhq/gitlab 17.10.0 does not match configured version
│ constraint >= 18.0.0; must use tofu init -upgrade to allow selection of new versions

Describe Ideal Solution

add init_run_upgrade or similar to atmos.yaml - or somehow have atmos detect when an upgrade is needed and run it for me.

Alternatives Considered

There are a few workarounds, vendor in my components always, somehow ensure there's no lockfile present, just run init manually with the upgrade flag, but this would be a nice QoL feature when needed

Additional Context

No response

zack-is-cool avatar May 21 '25 17:05 zack-is-cool

@zack-is-cool the proposal makes sense to me and is congruent with the other flag init_run_reconfigure. Alternatively, we could maybe add init_flags option.

Also, you can always execute atmos terraform init <component> -s <stack> -- -upgrade and specify any native TF flags after the double-dash double-dash -- can be used to signify the end of the options for Atmos and the start of the additional native arguments and flags for the terraform commands.

For example:

atmos terraform plan <component> -s <stack> -- -refresh=false
atmos terraform apply <component> -s <stack> -- -lock=false

osterman avatar May 29 '25 19:05 osterman