-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Stale/Old Plans Issue #1122
Comments
that setup sounds super confusing, but I've hit the same issue in a different manner so I'm curious as to a solution. |
We're using Atlantis/Terraform to control the entire stack for a bunch of services, including the k8s deployments, which is kind of how we ended up here. So far it has worked really well other than running into some weird cases like this one. It lets us be pretty specific about required approvals for different environments using codeowners, and also lets developers do basic infrastructure updates for their apps without having to get too in depth into the terraform code (mostly k8s image tag bumps). It doesn't look like this is getting much attention, so I'm guessing it's not an issue a ton of people are running into. It's definitely a pretty specific use case I'd say. |
I just stumbled onto this issue, and I'm also concerned. This is definitely a bug that could cause major issues. |
This happened to us as well in several occasions. I will try to investigate exactly how Atlantis works under the hood and try to find a proper solution. @lkysow are you aware of this bug? UPDATE:
In order to fix this bug we need to run |
@lkysow Is this something that can be fixed? |
We would like also this to be solved and we are willing to help with the PR as well. |
I like the suggestion of the OP of "The other good option seems to be forcing atlantis to destroy existing plans on any new commit to the PR." Adding at least an option for an implied |
There is an edge case in which if the plan files for modules (1),(2) have been already created for a commit (a) in a PR and then the user understands that he made a mistake and he didn't want to change module (2) and drops the terraform code of it in commit (b), then when the user will try to run the apply command Atlantis will apply the (2) module plan file as well as the `PendingPlanFinder.Find` finds all the differences between the upstream branch and what Atlantis contains and filters out the `.tfplan` files. There is an issue connected to this bug runatlantis#1122 In order to mitigate the above bug after some careful consideration it seems that the best solution is to drop all the plan files in case the PR has been locked anytime in the past, which translates that it most likely have created `.tfplan` files. This commit is not expected to create any side-effects or introduce any new problems.
There is an edge case in which if the plan files for modules (1),(2) have been already created for a commit (a) in a PR and then the user understands that he made a mistake and he didn't want to change module (2) and drops the terraform code of it in commit (b), then when the user will try to run the apply command Atlantis will apply the (2) module plan file as well as the `PendingPlanFinder.Find` finds all the differences between the upstream branch and what Atlantis contains and filters out the `.tfplan` files. There is an issue connected to this bug runatlantis#1122 In order to mitigate the above bug after some careful consideration it seems that the best solution is to drop all the plan files in case the PR has been locked anytime in the past, which translates that it most likely have created `.tfplan` files. This commit is not expected to create any side-effects or introduce any new problems.
Hey guys, |
Closed due to inactivity, if this still needed comment and we will reopen but check the latest docs/features first. |
Running into an interesting case based on our current configuration and would like some input on how to resolve it. Atlantis version is 0.14.0 . We have repos set up with the following files in the root of the repo -
variables_daily.tf
variables_staging.tf
variables_production.tf
These correspond to distinct Terraform workspaces, and is how we delineate the environments. For those repositories our atlantis.yaml looks like this -
The issue we're seeing is this:
atlantis apply
thinking they have safely removed production from the PROne way to mitigate this might be to flip the 'disable appply all' option to true, which would force them to be more explicit about it. There is some resistance to this, as developers like being able to bulk apply to daily and staging together.
The other good option seems to be forcing atlantis to destroy existing plans on any new commit to the PR. At the moment I do not see a direct way to do that, I'm thinking of using a custom workflow to always run atlantis unlock before any plan. Would that do the trick? And, if not, would a "destroy-on-plan" flag that set atlantis's behavior to trash all existing plans on a re-plan be a useful feature?
The text was updated successfully, but these errors were encountered: