-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix empty labels handling in Cluster resource (#2441)
This fixes the empty label handling in the GCP Cluster resource. In the fix for #2372 (#2386 and pulumi/pulumi-terraform-bridge#2417) we did not know that the labels property in GCP is sometimes overloaded, ex GCP Custer. For the Cluster resource, the GCP labels are under `resource_labels`, not `labels` This PR adds the logic to the empty labels fix and adds a regression test. fixes #2395
- Loading branch information
1 parent
00557a0
commit c55b95a
Showing
3 changed files
with
68 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: empty-label-cluster | ||
runtime: yaml | ||
resources: | ||
random-account-id: | ||
type: random:RandomString | ||
properties: | ||
length: 10 | ||
special: false | ||
upper: false | ||
number: false | ||
serviceAccount: | ||
type: gcp:serviceaccount:Account | ||
properties: | ||
accountId: ${random-account-id.result} | ||
primary: | ||
type: gcp:container:Cluster | ||
properties: | ||
location: us-central1 | ||
# We can't create a cluster with no node pool defined, but we want to only use | ||
# separately managed node pools. So we create the smallest possible default | ||
# node pool and immediately delete it. | ||
removeDefaultNodePool: true | ||
initialNodeCount: 1 | ||
deletionProtection: false | ||
resourceLabels: | ||
environment: "dev" | ||
test: "" | ||
outputs: | ||
labels: ${primary.resourceLabels} | ||
effectiveLabels: ${primary.effectiveLabels} | ||
pulumiLabels: ${primary.pulumiLabels} |