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

AdditionalLabels are not added to all GCP resources #1274

Closed
bfournie opened this issue Jun 27, 2024 · 0 comments · Fixed by #1275
Closed

AdditionalLabels are not added to all GCP resources #1274

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

Comments

@bfournie
Copy link
Contributor

/kind bug

Both the GCPClusterSpec and GCPMachineSpec have AdditionalLabels fields to add user-defined labels to the resources

e.g.
https://github.com/bfournie/cluster-api-provider-gcp/blob/main/api/v1beta1/gcpcluster_types.go#L55

     // AdditionalLabels is an optional set of tags to add to GCP resources managed by the GCP provider, in addition to the
       // ones added by default.
       // +optional
       AdditionalLabels Labels `json:"additionalLabels,omitempty"

We can see these labels being added to an instance here:
https://github.com/bfournie/cluster-api-provider-gcp/blob/main/cloud/scope/machine.go#L398

However other resources also take the Labels and this field is not being set, for example Disks, ForwardingRules, Addresses etc. (see https://raw.githubusercontent.com/googleapis/google-api-go-client/main/compute/v1/compute-gen.go)

What did you expect to happen:

The Labels field should be populated from AdditionalLabels for resources that have this field.

Anything else you would like to add:
Doing a openshift install using the capg-provider with the AdditionalLabels input set in the GCPCluster

Results in the instances getting the label

$ gcloud compute instances describe <instance-name>
...
labels:
  foo: bar

But no other resources get this label.

Environment:

Openshift 4.16 using capg 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