mirror of https://github.com/kubernetes/kops.git
Include GCP Project in terraform HCL2 output
This has been included in the JSON output but was missing from HCL2
This commit is contained in:
parent
159943eb8e
commit
3c1cc72d51
|
|
@ -17,7 +17,8 @@ output "region" {
|
|||
}
|
||||
|
||||
provider "google" {
|
||||
region = "us-test1"
|
||||
project = "us-test1"
|
||||
region = "us-test1"
|
||||
}
|
||||
|
||||
resource "google_compute_disk" "d1-etcd-events-ha-gce-example-com" {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,8 @@ output "region" {
|
|||
}
|
||||
|
||||
provider "google" {
|
||||
region = "us-test1"
|
||||
project = "us-test1"
|
||||
region = "us-test1"
|
||||
}
|
||||
|
||||
resource "google_compute_disk" "d1-etcd-events-minimal-gce-example-com" {
|
||||
|
|
|
|||
|
|
@ -42,6 +42,9 @@ func (t *TerraformTarget) finishHCL2(taskMap map[string]fi.Task) error {
|
|||
}
|
||||
providerBlock := rootBody.AppendNewBlock("provider", []string{providerName})
|
||||
providerBody := providerBlock.Body()
|
||||
if t.Cloud.ProviderID() == kops.CloudProviderGCE {
|
||||
providerBody.SetAttributeValue("project", cty.StringVal(t.Project))
|
||||
}
|
||||
providerBody.SetAttributeValue("region", cty.StringVal(t.Cloud.Region()))
|
||||
for k, v := range tfGetProviderExtraConfig(t.clusterSpecTarget) {
|
||||
providerBody.SetAttributeValue(k, cty.StringVal(v))
|
||||
|
|
|
|||
Loading…
Reference in New Issue