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

Auto added annotations serving.knative.dev/creator and serving.knative.dev/lastModifier do not play well with Terraform #7583

Comments

@steren
Copy link

steren commented Oct 20, 2020

Cloud Run automatically adds annotations to the created resources serving.knative.dev/creator and serving.knative.dev/lastModifier under metadata[0].annotations . This seems to cause troubles with Terraform (see example)

Would it be possible to ignore them by default?

It seems that adding this config helps:

lifecycle {
    ignore_changes = [
      metadata[0].annotations["serving.knative.dev/creator"],
      metadata[0].annotations["serving.knative.dev/lastModifier"]
    ]
  }
@rileykarson
Copy link
Collaborator

Retriaging to enhancement, since this is closer to additive behaviour than a bugfix.

@joshk0
Copy link
Contributor

joshk0 commented Nov 4, 2020

I disagree; this is an essential annotation for using google_cloud_run_domain_mapping so every single user of it will run into this issue, unless I'm mistaken.

By the way, the requirement for the BETA launch stage annotation was not originally there, and was added as a constraint later. I have resources in my tf state which are grandfathered in, it seems.

I think I'd rather have it set up so that if you're using the terraform resource, it automatically adds that annotation if it isn't there. That would solve the original issue without needing to mess with ignored annotations, since most people are likely to not use annotations at all after it is no longer required to specify the launch stage annotation.

@steren
Copy link
Author

steren commented Nov 5, 2020

I do not understand the previous comment. My request is about serving.knative.dev/creator and serving.knative.dev/lastModifier annotations. Launch stage should not be ignored.

@steren
Copy link
Author

steren commented Nov 6, 2020

The PR ignores everything that contains serving.knative.dev, which is dangerous IMO, the request was only to ignore serving.knative.dev/creator and serving.knative.dev/lastModifier

@joshk0
Copy link
Contributor

joshk0 commented Nov 6, 2020

I do not understand the previous comment. My request is about serving.knative.dev/creator and serving.knative.dev/lastModifier annotations. Launch stage should not be ignored.

My point was that most people are only using annotations to specify launch-stage, and that's only required because you can't use google_cloud_run_domain_mapping without using a launch-stage anymore. So I proposed that an alternative solution might include implying the beta launch stage whenever the domain mapping resource is used within terraform, and that might 'dodge' the problem rather than mandate a fix like what went in.

Given the approach that was taken, I agree that the ignoring strategy is a bit excessive.

@nat-henderson
Copy link
Contributor

I'll contact the author and see if they'd like to revise it. You propose ignoring specifically and exclusively serving.knative.dev/creator and serving.knative.dev/lastModifier?

@upodroid
Copy link
Contributor

upodroid commented Nov 6, 2020

Hey

I have used Knative and Cloud Run myself so i'm pretty confident there are no user settable annotations under the serving.knative.dev namespace.

I had a look at the API Spec for Knative Serving at https://knative.dev/docs/serving/spec/knative-api-specification-1.0/ and it looks like annotations like serving.knative.dev/* are set by other components of Knative that end users shouldn't be manipulating.

@ScottSuarez
Copy link
Collaborator

I have a PR to restrict the annotations to the specific values that Cloud Run adds. Better to be precise about what we ignore imo.

GoogleCloudPlatform/magic-modules#4202

@ghost
Copy link

ghost commented Dec 5, 2020

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.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Dec 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.