Skip to content

Add diff suppress for empty/default pod_security_policy_config #1670

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

Merged
merged 2 commits into from
Jun 19, 2018

Conversation

emilymye
Copy link
Contributor

Fixes #1667

@emilymye emilymye closed this Jun 19, 2018
@emilymye emilymye deleted the container_cluster branch June 19, 2018 17:48
@emilymye emilymye restored the container_cluster branch June 19, 2018 17:49
@emilymye emilymye reopened this Jun 19, 2018
@emilymye
Copy link
Contributor Author

accidently deleted the remote branch herp

@@ -1555,3 +1556,17 @@ func masterAuthClientCertCfgSuppress(k, old, new string, r *schema.ResourceData)

return strings.HasSuffix(k, ".issue_client_certificate") && old == "" && new == "true"
}

func podSecurityPolicyCfgSuppress(k, old, new string, r *schema.ResourceData) bool {
if strings.HasSuffix(k, "pod_security_policy_config.#") && old == "1" && new == "0" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HasSuffix doesn't make much sense if the next step is to GetOk an unprefixed pod_security_policy_config - should it just be '=='?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure if k actually starts with pod_security_policy_config or has resource-specific naming prefix (i.e. google_container_cluster.my_cluster.pod_security_policy_config.#). Since it wasn't the same value necessarily as the keys for r, I thought I'd err on the cautious side but I can change it.

@emilymye emilymye merged commit a2b95e3 into hashicorp:master Jun 19, 2018
@ghost
Copy link

ghost commented Nov 17, 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 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Nov 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants