-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Cloud Run metadata annotations: Provider produced inconsistent final plan #13578
Cloud Run metadata annotations: Provider produced inconsistent final plan #13578
Comments
@aarcarons have you checked lifecycle to see if it helps? |
@edwardmedia I can confirm that after adding an ignore_changes block for each of the unmodified annotations, the plan looks as expected and the apply succeeds. However, this defeats the purpose of the terraform code above. The goal was to patch the annotations by adding (or updating) the one that controls the ingress settings while also keeping the rest. See the Handpicking in advance which annotations need to be excluded and adding them to the ignore_changes block might not always be possible. New annotations might be created independently from terraform, which would lead to the plan failing |
@aarcarons Did you notice the behavior of |
I understand that additional annotations might be added externally. What I'm looking for is a way to avoid having to ignore these annotations explicitly via We're passing the full list of annotations every time and still, the diff shows that annotations will be deleted. So there must be something wrong with the provider that causes the inconsistent diff at the |
@aarcarons not sure what causes |
@edwardmedia @melinath I'm not sure how I can create a static example to reproduce this, I don't have much experience with unit testing terraform providers. I tried to create a smaller example (which would still require to create a cloud run service) but couldn't reproduce. It could depend on the order in which Cloud Run API returns the annotations? Or maybe it's related with the code that suppresses certain annotations from the diff? |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
Affected Resource(s)
Terraform Configuration Files
where
var.ingress
is a string variable defined as follows:The input given for the failing case is
all
.Debug Output
This seems to be a flaky issue. It doesn't always reproduce. When I tried to run the apply with the debug option the issue didn't reproduce.
In the meantime, please see the output of a failing plan - apply.
Plan
Apply
Expected Behavior
The purpose of our Terraform code is to add the metadata annotation
run.googleapis.com/ingress
while keeping any other metadata annotations that the service might have.In this case, the annotation already exists with the desired value.
The expected behaviour would be that the plan reports no changes to be done on the annotation list. Apply shouldn't be removing any annotation from the list.
Actual Behavior
Plan reports 6 annotations to be removed. Apply fails reporting inconsistent final plan with the error messages shown above.
This is not reproduced 100% of the times.
Steps to Reproduce
With an existing cloud run service and the terraform code shown above.
terraform apply
References
The text was updated successfully, but these errors were encountered: