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

k8s/utils: correctly filter out labels in StripPodSpecialLabels #31421

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

tklauser
Copy link
Member

@tklauser tklauser commented Mar 15, 2024

Filter the labels before iterating them, otherwise they are added to sanitizedLabels again. Also remove forbidden keys prefixed with io.cilium.k8s because they are already filtered out by filterPodLabels and inline the check for kubernetes namespace labels.

Fixes: ed4e650 ("k8s/utils: filter out cilium-owned labels on pod update")

@tklauser tklauser added kind/bug This is a bug in the Cilium logic. release-note/bug This PR fixes an issue in a previous release of Cilium. backport/author The backport will be carried out by the author of the PR. needs-backport/1.13 This PR / issue needs backporting to the v1.13 branch needs-backport/1.14 This PR / issue needs backporting to the v1.14 branch needs-backport/1.15 This PR / issue needs backporting to the v1.15 branch labels Mar 15, 2024
@tklauser tklauser requested a review from a team as a code owner March 15, 2024 14:50
@tklauser tklauser requested a review from youngnick March 15, 2024 14:50
@tklauser
Copy link
Member Author

/test

@tklauser tklauser force-pushed the pr/tklauser/fix-strip-pod-special-labels branch from a9cf6a3 to 22b6c3a Compare March 15, 2024 14:58
@tklauser
Copy link
Member Author

/test

Filter the labels before iterating them, otherwise they are added to
sanitizedLabels again. Also remove forbidden keys prefixed with
io.cilium.k8s because they are already filtered out by filterPodLabels
and inline the check for kubernetes namespace labels.

Fixes: ed4e650 ("k8s/utils: filter out cilium-owned labels on pod update")
Signed-off-by: Tobias Klauser <tobias@cilium.io>
@tklauser tklauser force-pushed the pr/tklauser/fix-strip-pod-special-labels branch from 22b6c3a to 6bc7599 Compare March 15, 2024 15:01
@tklauser
Copy link
Member Author

/test

@tklauser tklauser enabled auto-merge March 15, 2024 15:01
@tklauser tklauser requested review from sayboras and removed request for youngnick March 18, 2024 20:14
Copy link
Member

@sayboras sayboras left a comment

Choose a reason for hiding this comment

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

Nice finding ✔️

@tklauser tklauser added this pull request to the merge queue Mar 19, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Mar 19, 2024
Merged via the queue into main with commit 280b69d Mar 19, 2024
225 checks passed
@tklauser tklauser deleted the pr/tklauser/fix-strip-pod-special-labels branch March 19, 2024 08:29
@tklauser tklauser added backport-pending/1.14 The backport for Cilium 1.14.x for this PR is in progress. backport-pending/1.15 The backport for Cilium 1.15.x for this PR is in progress. and removed needs-backport/1.14 This PR / issue needs backporting to the v1.14 branch needs-backport/1.15 This PR / issue needs backporting to the v1.15 branch needs-backport/1.13 This PR / issue needs backporting to the v1.13 branch labels Mar 19, 2024
@tklauser tklauser added the backport-pending/1.13 The backport for Cilium 1.13.x for this PR is in progress. label Mar 19, 2024
@tklauser tklauser mentioned this pull request Mar 19, 2024
2 tasks
@github-actions github-actions bot added backport-done/1.14 The backport for Cilium 1.14.x for this PR is done. backport-done/1.15 The backport for Cilium 1.15.x for this PR is done. backport-done/1.13 The backport for Cilium 1.13.x for this PR is done. and removed backport-pending/1.14 The backport for Cilium 1.14.x for this PR is in progress. backport-pending/1.15 The backport for Cilium 1.15.x for this PR is in progress. backport-pending/1.13 The backport for Cilium 1.13.x for this PR is in progress. labels Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/author The backport will be carried out by the author of the PR. backport-done/1.13 The backport for Cilium 1.13.x for this PR is done. backport-done/1.14 The backport for Cilium 1.14.x for this PR is done. backport-done/1.15 The backport for Cilium 1.15.x for this PR is done. kind/bug This is a bug in the Cilium logic. 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
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants