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

google_logging_project_sink always shows changed if filter has trailing whitespace #1162

Closed
michaelbannister opened this issue Mar 7, 2018 · 2 comments
Labels

Comments

@michaelbannister
Copy link
Contributor

I use a HEREDOC string to specify filter for a google_logging_project_sink, which includes a trailing newline.
The value as refreshed from the google API is without a trailing newline, so it always shows as changed.

Affected Resource(s)

Please list the resources as a list, for example:

  • google_logging_project_sink

Terraform Configuration Files

resource "google_logging_project_sink" "logs" {
  name = "${local.logging_name}_logs_sink"
  destination = "pubsub.googleapis.com/projects/${data.google_client_config.current.project}/topics/${local.topic_name}"
  filter = <<EOF
resource.type="container"
resource.labels.cluster_name="${var.cluster_name}"
NOT (jsonPayload.wUserAgent="GoogleHC/1.0" OR textPayload:"GoogleHC/1.0" OR jsonPayload.wUserAgent="kube-probe/1.8+"
OR resource.labels.container_name="a" OR resource.labels.container_name="b" OR resource.labels.container_name="c")
EOF
  unique_writer_identity = true
}

Expected Behavior

Upon repeated apply, no change

Actual Behavior

Upon repeated apply,

 ~ module.cluster_logging.google_logging_project_sink.applogs
      filter:     "resource.type=\"container\"\nresource.labels.cluster_name=\"flexi\"\n(resource.labels.container_name=\"a\" OR resource.labels.container_name=\"b\" OR resource.labels.container_name=\"c\")\nNOT (jsonPayload.wUserAgent=\"GoogleHC/1.0\" OR textPayload:\"GoogleHC/1.0\" OR jsonPayload.wUserAgent=\"kube-probe/1.8+\")" => "resource.type=\"container\"\nresource.labels.cluster_name=\"flexi\"\n(resource.labels.container_name=\"a\" OR resource.labels.container_name=\"b\" OR resource.labels.container_name=\"c\")\nNOT (jsonPayload.wUserAgent=\"GoogleHC/1.0\" OR textPayload:\"GoogleHC/1.0\" OR jsonPayload.wUserAgent=\"kube-probe/1.8+\")\n"

References

@danawillow
Copy link
Contributor

Fixed in #1206

@ghost
Copy link

ghost commented Nov 18, 2018

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 and limited conversation to collaborators Nov 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants