-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Fix List() calls that didn't fill in revision #9599
Open
fasaxc
wants to merge
5
commits into
projectcalico:master
Choose a base branch
from
fasaxc:fix-missing-rev
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fasaxc
added
cherry-pick-candidate
docs-not-required
Docs not required for this change
labels
Dec 13, 2024
marvin-tigera
added
the
release-note-required
Change has user-facing impact (no matter how small)
label
Dec 13, 2024
caseydavenport
approved these changes
Dec 13, 2024
fasaxc
force-pushed
the
fix-missing-rev
branch
from
December 13, 2024 18:12
27fb6ea
to
69aec51
Compare
caseydavenport
previously approved these changes
Dec 13, 2024
The watchercache requires the KVList to contain the revision for correctness. Without it, it can miss updates from the server. Fix the resources that were missing the revision and panic if the revision is missing to surface the problem in future.
fasaxc
force-pushed
the
fix-missing-rev
branch
from
December 16, 2024 13:30
69aec51
to
3130b5f
Compare
Replace Gets() with lists that filter on name.
fasaxc
force-pushed
the
fix-missing-rev
branch
from
December 19, 2024 10:53
aceb176
to
dda0f92
Compare
fasaxc
force-pushed
the
fix-missing-rev
branch
from
December 19, 2024 11:46
e193b8c
to
3384f89
Compare
Looks like k8s might return that in some cases (customK8sResourceClient checks for it).
fasaxc
force-pushed
the
fix-missing-rev
branch
from
December 19, 2024 11:48
3384f89
to
0995bc6
Compare
CNI plugin relies on its List() being turned into a Get() for a single Pod. It doesn't have RBAC permissions for list and it only uses List() because one pod can result in >1 WEP.
fasaxc
dismissed
caseydavenport’s stale review
December 20, 2024 10:38
Big changes: refactored to use list with fieldSelector
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
cherry-pick-candidate
docs-not-required
Docs not required for this change
release-note-required
Change has user-facing impact (no matter how small)
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The watchercache requires the KVList to contain the collection resource version for correctness. Without it, it can miss updates from the datastore.
List()
calls intoGet()
calls when only one resource was needed. This code was incorrect becauseGet()
doesn't return the "collection resource version", which is what aList()
call should return (and must return for a subsequentWatch()
to function correctly).Get()
use aList()
with aFieldSelector
that matches on the name of the resource. This returns the same resource but it wraps it in a List object that carries the needed collection version.WorkloadEndpoint
behind an opt-inContext
flag (with a nice long name to make users of the hacky flag feel bad :-P). The CNI plugin relies on that logic to avoid needinglist
RBAC permissions for Pods.Related issues/PRs
Todos
Release Note
Reminder for the reviewer
Make sure that this PR has the correct labels and milestone set.
Every PR needs one
docs-*
label.docs-pr-required
: This change requires a change to the documentation that has not been completed yet.docs-completed
: This change has all necessary documentation completed.docs-not-required
: This change has no user-facing impact and requires no docs.Every PR needs one
release-note-*
label.release-note-required
: This PR has user-facing changes. Most PRs should have this label.release-note-not-required
: This PR has no user-facing changes.Other optional labels:
cherry-pick-candidate
: This PR should be cherry-picked to an earlier release. For bug fixes only.needs-operator-pr
: This PR is related to install and requires a corresponding change to the operator.