Skip to content

fix: filter labels in direct ComputeForwardingRule controller - #4808

Merged
google-oss-prow[bot] merged 1 commit into
GoogleCloudPlatform:masterfrom
justinsb:label_filtering
Jul 17, 2025
Merged

google-oss-prow[bot] merged 1 commit into
GoogleCloudPlatform:masterfrom
justinsb:label_filtering

Conversation

@justinsb

Copy link
Copy Markdown
Collaborator

No description provided.

@gemmahou

gemmahou commented Jul 17, 2025 •

Copy link
Copy Markdown
Collaborator

/lgtm

I'm okay with merging this to unblock release 1.133.

Further questions:

  1. Do we still need Support spec.labels for ComputeForwardingRule #4748 to ensure the CFR direct controller supports spec.labels as described in the design doc?
  2. CFR is still using "reconciliation gate"; I'm planning to remove it and make direct reconciliation as default, but I'm unsure if we should support spec.labels first and get some feedback.

cc: @yuwenma

labels:
label-one: "value-one"
foo/not-valid-in-gcp: bar
foo: bar

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: foo: bar seems redundant as we have label-one: "value-one". To test update, we could simply update it to label-one: "value-two" in below update.yaml.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove line 110? (managed-by-cnrm)

mapCtx := &direct.MapContext{}

desired := a.desired.DeepCopy()
sanitizedLabels := label.NewGCPLabelsFromK8sLabels(desired.Labels)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This meta label will override the spec labels, but I think we want the opposite:

  • If spec.labels are purposely used, we ignore meta labels.
    Can we use labels.ComputeLabels in adapter initialization so we can get rid of these code changes?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't support spec.labels in this PR yet, so I'm not concerned about the override and it's fine to keep the code as is. I'll use labels.ComputeLabels once we add the spec.labels field.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. That makes sense. So basically this PR handles the direct controller backward compatibility support for labels, and in the future we can add the spec.labels.

@yuwenma

yuwenma commented Jul 17, 2025

Copy link
Copy Markdown
Contributor

/approve

@google-oss-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yuwenma

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow
google-oss-prow Bot merged commit b6602eb into GoogleCloudPlatform:master Jul 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants