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

ForwardingRules' labels must be added via the SetLabels() method #1276

Closed
bfournie opened this issue Jun 28, 2024 · 0 comments · Fixed by #1277
Closed

ForwardingRules' labels must be added via the SetLabels() method #1276

bfournie opened this issue Jun 28, 2024 · 0 comments · Fixed by #1277
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@bfournie
Copy link
Contributor

/kind bug

What steps did you take and what happened:
In #1275, the ForwardingRules Labels field was set in the resource definition. It turns out that some resources, including ForwardingRules, require theSetLabels() method to add the labels. This is the comment for ForwardingRules in https://github.com/googleapis/google-api-go-client/blame/main/compute/v1/compute-gen.go

       // Labels: Labels for this resource. These can only be added or modified
        // by the setLabels method. 
        Labels map[string]string `json:"labels,omitempty"

This is different than other resources, for example Instances and Disks, in which the Label can be set in the resource and later modified using SetLabels(). This is the description in compute-gen.go

        // Labels: Labels to apply to this instance. These can be later modified
        // by the setLabels method.
        Labels map[string]string `json:"labels,omitempty"`

What did you expect to happen:
So, the end result is that the change to add Labels to the resources when creating it works fine for Disks but does not work for ForwardingRules which require SetLabels() to be used after the resource is create.

Anything else you would like to add:
Will need to change ForwardingRules to use SetLabels() .

Environment:
Openshift 4.16 using cluster-api-provider-gcp as provider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants