-
Notifications
You must be signed in to change notification settings - Fork 53
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
Fix labels perma diff #2386
Fix labels perma diff #2386
Conversation
Does the PR have any schema changes?Looking good! No breaking changes found. Maintainer note: consult the runbook for dealing with any breaking changes. |
f8d9702
to
c9868fc
Compare
dceb55c
to
4230ada
Compare
4230ada
to
91f0ec4
Compare
91f0ec4
to
094a682
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also add a test for unmanaged labels? You can use the gcloud CLI:
gcloud storage buckets update $bucket_name --update-labels=unmanaged=value,unmanaged_empty=
I don't think we are handling unmanaged labels correctly here. We should add a test for that case, both for empty and non-empty unmanaged labels. |
094a682
to
fcf1ebd
Compare
It doesn't clober, though the upstream refresh behavior isn't great. I'll add a test and see if I can improve upstream's behavior. |
Note, somewhat related: #1946 bucket has slightly different behaviour when importing labels. |
I added a regression test, but I'm not going to tackle fixing labels in this PR. I opened #2390 to track general unmanaged labels work. |
Can you please clarify what the actual problem is in #2390? Is it the effectiveLabels output changing during Refresh? If so, that seems expected. |
No, it's that it changes during the subsequent update, not during the refresh. I have clarified in the issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - glad this worked out!
Two points here:
- Unit tests on the fixup function would be nice for whoever has to interact with this next - it helps to illustrate the desired behaviour as it is not obvious what the GCP provider returns when we interact with the Plan - happy to punt this for after fixing the issue if we want to ship sooner.
- Why do we not fix unmanaged labels? Why do we treat them differently?
761b856
to
f128f7e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for linking the outstanding work in the bridge and follow-up. A few clarifying requests here.
@@ -1120,3 +1124,215 @@ func TestFirestoreDatabaseAutoname(t *testing.T) { | |||
pt.SetConfig("gcpProj", proj) | |||
pt.Up() | |||
} | |||
|
|||
func TestEmptyLabels(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we expect empty labels to behave? Can that be part of the test name?
a silly example - TestEmptyLabelsDefaultToCake
- tells me Pulumi should rewrite all empty labels to say "cake".
Also - this needs pulumi/pulumi-terraform-bridge#2417 to merge and even release before we can merge here, right? |
The issue with |
Ran a few manual tests here:
|
This PR takes advantage of pulumi/pulumi-terraform-bridge#2417 to fixup the incorrect planned state caused by empty labels. Fixes #2372
8a8d6c8
to
9cd8120
Compare
This PR has been shipped in release v8.2.0. |
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
This PR takes advantage of pulumi/pulumi-terraform-bridge#2417 to fixup the incorrect planned state caused by empty labels.
Fixes #2372
Before merging