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

Add issue_client_certificate to cluster #1396

Merged

Conversation

emilymye
Copy link
Contributor

Fixes #1378.

  • Also changed test name so go test filter doesn't conflict with MasterAuthorization...Tests

make testacc TEST=./google TESTARGS='--run="TestAccContainerCluster_withMasterAuthConfig"'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./google -v --run="TestAccContainerCluster_withMasterAuthConfig" -timeout 120m
=== RUN TestAccContainerCluster_withMasterAuthConfig
=== PAUSE TestAccContainerCluster_withMasterAuthConfig
=== RUN TestAccContainerCluster_withMasterAuthConfig_NoCert
=== PAUSE TestAccContainerCluster_withMasterAuthConfig_NoCert
=== CONT TestAccContainerCluster_withMasterAuthConfig
=== CONT TestAccContainerCluster_withMasterAuthConfig_NoCert
--- PASS: TestAccContainerCluster_withMasterAuthConfig_NoCert (394.82s)
--- PASS: TestAccContainerCluster_withMasterAuthConfig (396.11s)
PASS
ok github.com/terraform-providers/terraform-provider-google/google 396.281s

TF_ACC=1 go test ./google -v --run="TestAccContainerClusterDatasource_basic" -timeout 120m
=== RUN TestAccContainerClusterDatasource_basic
=== PAUSE TestAccContainerClusterDatasource_basic
=== CONT TestAccContainerClusterDatasource_basic
--- PASS: TestAccContainerClusterDatasource_basic (311.69s)
PASS
ok github.com/terraform-providers/terraform-provider-google/google 311.870s

@emilymye emilymye requested a review from rosbo April 27, 2018 22:34
if len(cluster.MasterAuth.ClientCertificate) == 0 {
masterAuth[0]["client_certificate_config"] = []map[string]interface{}{
{"issue_client_certificate": false},
}
Copy link
Contributor

Choose a reason for hiding this comment

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

If you set issue_client_certificate to true in a else statement to this if, I think it would simplify masterAuthClientCertCfgSuppress since it will only need to handle one case:
[{ "issue_client_certificate": true}] --> []

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 wanted to do it like that first :/ The problem with that approach is that we don't actually have access to the old data (i.e. issue_client_certificate=true) in the diff suppress function, and because the new value is nil, it doesn't attempt to do the diff of issue_client_certificate.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see 👍

@emilymye emilymye merged commit ac64624 into hashicorp:master Apr 28, 2018
@ellipticasec
Copy link

Thanks @emilymye you rock !

@emilymye emilymye deleted the gke_cluster_no_issue_client_cert_1378 branch June 19, 2018 17:48
@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 👉 hashibot-feedback@hashicorp.com. 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.

3 participants