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

pkg/redirectpolicy: Make code robust against incorrect policy configu… #16216

Merged

Conversation

aditighag
Copy link
Member

@aditighag aditighag commented May 19, 2021

See commit message.

Fixes: #16204

Release note

Fix a crash where user specifies incorrect service name in a local redirect policy config, or policy selected service is added after the policy is added.

@aditighag aditighag requested review from a team and christarazi May 19, 2021 07: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 May 19, 2021
@aditighag aditighag requested a review from joamaki May 19, 2021 07:41
@aditighag aditighag marked this pull request as draft May 19, 2021 07:41
@aditighag aditighag added the release-note/bug This PR fixes an issue in a previous release of Cilium. label May 19, 2021
@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 May 19, 2021
@maintainer-s-little-helper maintainer-s-little-helper bot added this to Needs backport from master in 1.9.8 May 19, 2021
@aanm aanm added this to Needs backport from master in 1.9.9 May 27, 2021
@aanm aanm removed this from Needs backport from master in 1.9.8 May 27, 2021
@joamaki
Copy link
Contributor

joamaki commented Jun 14, 2021

@aditighag hey, what's the status of this PR? I've been waiting for it to be marked ready for review before having a look.

@aditighag
Copy link
Member Author

test-only --focus="K8sServicesTest.* LRP" --kernel_version="net-next"

@joestringer joestringer added this to Needs backport from master in 1.9.10 Jul 19, 2021
@joestringer joestringer removed this from Needs backport from master in 1.9.9 Jul 19, 2021
@stale
Copy link

stale bot commented Jul 20, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added stale The stale bot thinks this issue is old. Add "pinned" label to prevent this from becoming stale. and removed stale The stale bot thinks this issue is old. Add "pinned" label to prevent this from becoming stale. labels Jul 20, 2021
@aditighag aditighag force-pushed the pr/aditighag/lrp-fix-incorrect-config branch from 4cbaf5f to 70d510a Compare July 20, 2021 23:55
@aditighag
Copy link
Member Author

aditighag commented Jul 20, 2021

test-only --focus="K8sLRPTests" --kernel_version="net-next"

Rebased the PR.

@aditighag aditighag marked this pull request as ready for review July 20, 2021 23:57
@aditighag
Copy link
Member Author

Focused tests relevant to the code changes (LRP tests) have passed.

pkg/k8s/service_cache.go Outdated Show resolved Hide resolved
pkg/redirectpolicy/manager.go Outdated Show resolved Hide resolved
pkg/redirectpolicy/manager.go Outdated Show resolved Hide resolved
@christarazi christarazi marked this pull request as draft July 29, 2021 16:47
@joamaki joamaki removed the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Aug 12, 2021
@aditighag
Copy link
Member Author

aditighag commented Aug 12, 2021

Reviews are in and focused LRP tests have passed - https://jenkins.cilium.io/job/Cilium-PR-Tests-Kernel-Focus/293/.

Based on the out-of-band comment from Jussi, I've added a comment in the commit description and the code. No need to re-run the test.

Edit : checkpath warning can be ignored -

ERROR:CUSTOM: Please avoid long commit subjects (max: 75, found: 76)

…rations

If an incorrect service name is specified in an LRP, we need to guard against
this case when service IP can't be retrieved.
Also, when a valid LRP is applied before the service it selects, service information
won't be available in the manager callback to add an LRP. The LRP will be
applied when the service callback is later received by the manager.

Signed-off-by: Aditi Ghag <aditi@cilium.io>
@aditighag aditighag force-pushed the pr/aditighag/lrp-fix-incorrect-config branch from 43ee72c to ce0d7af Compare August 12, 2021 15:53
@aditighag aditighag added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Aug 12, 2021
@ti-mo ti-mo merged commit fbeb5c8 into cilium:master Aug 13, 2021
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from master to Backport pending to v1.9 in 1.9.10 Aug 13, 2021
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Backport pending to v1.9 to Needs backport from master in 1.9.10 Aug 13, 2021
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from master to Backport pending to v1.9 in 1.9.10 Aug 17, 2021
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from master to Backport pending to v1.10 in 1.10.4 Aug 18, 2021
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Backport pending to v1.10 to Backport done to v1.10 in 1.10.4 Aug 19, 2021
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Backport pending to v1.9 to Backport done to v1.9 in 1.9.10 Sep 1, 2021
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Backport pending to v1.9 to Backport done to v1.9 in 1.9.10 Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/bug This PR fixes an issue in a previous release of Cilium.
Projects
No open projects
1.10.4
Backport done to v1.10
1.9.10
Backport done to v1.9
Development

Successfully merging this pull request may close these issues.

localRedirectPolicy: pointing to a non-existent service crashes the agent
7 participants