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

deploy/gcp: fix apply issue and simplify terraform configuration #861

Merged
merged 3 commits into from
Sep 4, 2019

Conversation

cofyc
Copy link
Contributor

@cofyc cofyc commented Sep 2, 2019

What problem does this PR solve?

fix #859

we should not create the file again with its content. terraform will not
skip creation even if the content does not change. so terraform will
destroy the file and the new file cannot be created anymore

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Steps to test:

  • terraform apply -var-file small.tfvars -state small.tfstate
  • terraform apply -var-file small.tfvars -var 'tidb_version=v3.0.2' -state small.tfstate
  • terraform refresh -var-file small.tfvars -var 'tidb_version=v3.0.2' -state small.tfstate
  • terraform destroy -var-file small.tfvars -var 'tidb_version=v3.0.2' -state small.tfstate

Does this PR introduce a user-facing change?:

deploy/gcp: fix an issue that kubeconfig may be destroyed in apply phrase

we should not create the file again with its content. terraform will not
skip creation even if the content does not change. so terraform will
destroy the file and the new file cannot be created anymore
@cofyc cofyc requested a review from jlerche September 2, 2019 11:15
@@ -20,7 +9,8 @@ provider "helm" {
# we defer initialization by using load_config_file argument.
# See https://github.com/pingcap/tidb-operator/pull/819#issuecomment-524547459
config_path = local.kubeconfig
load_config_file = local_file.kubeconfig.filename != "" ? true : false
# used to delay helm provisioner initialization in apply phrase
load_config_file = module.tidb-operator.get_credentials_id != "" ? true : null
Copy link
Contributor Author

Choose a reason for hiding this comment

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

module.tidb-operator.get_credentials_id can serve same purpose

@weekface
Copy link
Contributor

weekface commented Sep 2, 2019

add a release note?

@cofyc cofyc requested a review from gregwebs September 2, 2019 11:23
Copy link
Contributor

@jlerche jlerche left a comment

Choose a reason for hiding this comment

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

LGTM

@gregwebs
Copy link
Contributor

gregwebs commented Sep 4, 2019

/run-e2e-tests

@cofyc cofyc merged commit aa00e1a into pingcap:master Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

deploy/gcp: kubeconfig local_file is destroyed in upgrade
4 participants