Skip to content

pkg/redirectpolicy: Delete unused variable in getAndUpsertPolicySvcCo… #35794

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

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

Sm0ckingBird
Copy link
Contributor

In the handler of case svcFrontendNamedPorts, the "ports" is allocated and assigned with values, but never used. Thus, delete the related code.

Fixes: e7bb8a7 ("k8s/cilium Event handlers and processing logic for LRPs")

@Sm0ckingBird Sm0ckingBird requested a review from a team as a code owner November 6, 2024 01:41
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Nov 6, 2024
@github-actions github-actions bot added the kind/community-contribution This was a contribution made by a community member. label Nov 6, 2024
@dylandreimerink
Copy link
Member

@aditighag I don't have to proper context on this specific bit of code. The unused variable seems to be there since the file was first created. Is this really dead code or is it a bug that we are not doing anything with the configured port names?

@ysksuzuki ysksuzuki self-requested a review November 7, 2024 06:08
Copy link
Member

@ysksuzuki ysksuzuki left a comment

Choose a reason for hiding this comment

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

Nice catch. Thanks! Just one nit.

I check the code here and indeed, there's no need to retrieve the port names here. What’s needed here is the ClusterIP of the frontend service and set it to feAddr.AddrCluster and update policyFrontendsByHash and policyConfigs

@ysksuzuki
Copy link
Member

/test

@julianwiedmann julianwiedmann added kind/cleanup This includes no functional changes. area/lrp Impacts Local Redirect Policy. release-note/misc This PR makes changes that have no direct user impact. labels Nov 8, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Nov 8, 2024
…nfig

In the handler of case svcFrontendNamedPorts, the "ports" is allocated
and assigned with values, but never used. Thus, delete the related code.

Fixes: e7bb8a7 ("k8s/cilium Event handlers and processing logic for LRPs")

Signed-off-by: Zijian Zhang <zijianzhang@bytedance.com>
@julianwiedmann
Copy link
Member

/test

@julianwiedmann julianwiedmann added this pull request to the merge queue Nov 8, 2024
Merged via the queue into cilium:main with commit 0cdca97 Nov 8, 2024
64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/lrp Impacts Local Redirect Policy. kind/cleanup This includes no functional changes. kind/community-contribution This was a contribution made by a community member. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants