Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.28.5 destroying using atlantis plan -- -destroy no longer works #4999

Closed
nitrocode opened this issue Oct 11, 2024 · 2 comments
Closed

0.28.5 destroying using atlantis plan -- -destroy no longer works #4999

nitrocode opened this issue Oct 11, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@nitrocode
Copy link
Member

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Overview of the Issue

I noticed in 0.27.3 that i could use atlantis plan -- -destroy to destroy resources

In 0.28.5 and later, it returns a regular plan instead of a destroy plan.

Reproduction Steps

In older version

  1. Open pr
  2. Select a dir to destroy
  3. Run atlantis plan -d xyz -- -destroy

See destroy plan which shouldn only destroy with 0 create and modify as per docs https://www.runatlantis.io/docs/using-atlantis.html#using-the-destroy-flag

Logs

TBD

Environment details

TBD

Additional Context

N/A

@nitrocode nitrocode added bug Something isn't working regression Bug introduced in a new version labels Oct 11, 2024
Copy link

dosubot bot commented Oct 11, 2024

I found related issues that might be helpful:

To continue talking to Dosu, mention @dosu.

@nitrocode
Copy link
Member Author

nitrocode commented Oct 11, 2024

The issue was replacing the plan in the workflow config with the following which accidentally subtracted the $COMMENT_ARGS

-        - plan
+        - run: |
+            terraform$ATLANTIS_TERRAFORM_VERSION plan -input=false -refresh -out $PLANFILE

and it should have been (or similar)

-        - plan
+        - run: |
+            terraform$ATLANTIS_TERRAFORM_VERSION plan -input=false -refresh -out $PLANFILE $(printf '%s' $COMMENT_ARGS | sed 's/,/ /g' | tr -d '\\')

It might be good to document the default plan and apply stages so if customization is needed, we can keep it 1:1.

Ref

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant