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

Remediate watch filter label removal #1328

Conversation

karlkfi
Copy link
Contributor

@karlkfi karlkfi commented Jul 10, 2024

This change handles future cases where watch filtering by label causes delete events when the required label is removed.

This blocks watch filtering: #1301

This change handles future cases where watch filtering by label
causes delete events when the required label is removed.
@karlkfi karlkfi force-pushed the karl-remediator-handle-deletes branch from 1caf605 to df7767c Compare July 11, 2024 18:32
fake.ClusterRoleBindingObject(syncertest.ManagementEnabled),
},
eventObjs: []client.Object{
// Watch server treats update to remove required label as a delete.
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you have a link to the code? I'm curious about what labels are required.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When you use label selectors in the watch, it sends a delete event when the selected label is removed.

I asked apimachinery if this was a bug and they said it was working as intended. I haven't gone and tracked down the code for it in the apiserver. It's probably buried in the storage layer.

With our current watches, we don't have any label selectors, so this hasn't been an issues. But for #1301 it's causing two of the conflict e2e tests to fail because they not correctly detecting the label removal, so there's no conflict error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

More explanation here: go/config-sync-watch-filter#heading=h.tpnna8sp25vg

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually the "filtering" test immediately after that shows the same behavior for label selectors.

Copy link
Contributor

@nan-yu nan-yu left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nan-yu

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

The pull request process is described here

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 b478dcd into GoogleContainerTools:main Jul 11, 2024
6 checks passed
@karlkfi karlkfi deleted the karl-remediator-handle-deletes branch July 11, 2024 18:56
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.

None yet

2 participants