[release-0.31] Fix permission claim defaultSelector hiding claimed resources - #4340
Conversation
|
Hi @anastazya. Thanks for your PR. I'm waiting for a kcp-dev member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Why is this not just a Should work just fine? |
|
You're right, I overcomplicated this. The cherry-pick works with the conflict resolved as you described, and the unit and E2E tests pass. I'll replace the current commit and keep the original author. |
ToLabelKeyAndValue JSON-marshals the entire PermissionClaim to derive the label used to identify claimed objects. The APIExport virtual workspace reconciler hashes the APIExport's claim (which may carry a defaultSelector) to build the LIST/WATCH filter, while the permissionclaim labeler hashes the APIBinding's accepted claim (which never carries a defaultSelector) to label the objects. With a defaultSelector present the two hashes diverge, so the filter never matches the labeled objects and claimed resources become invisible through the APIExport endpoint. defaultSelector (like the binding-time selector and verbs) scopes access; it is not part of a claim's identity and is enforced separately. Exclude it from the hash. Claims without a defaultSelector are unaffected, so no migration is needed. Adds a unit regression test and an e2e test that lists a claimed configmap through the APIExport virtual workspace when the APIExport claim carries a defaultSelector. Fixes kcp-dev#4198 (cherry picked from commit c37085b) Signed-off-by: Theodor Ganescu <star.sg1@gmail.com>
95419d8 to
6523233
Compare
|
/kind bug |
|
LGTM label has been added. DetailsGit tree hash: 17c23813f9eaf809d9697ff65b04c56ed7fc5eb1 |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: xrstf The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
Summary
Manual cherry-pick of #4200 to
release-0.31.The cherry-pick had one modify/delete conflict because
labels_test.godoes not exist on this branch. I kept the upstream version of that test file. The resulting commit preserves the original author and the full upstream regression coverage.Validation:
(cd staging/src/github.com/kcp-dev/sdk && go test ./... -count=1)go test ./test/e2e/virtual/apiexport -run '^TestAPIExportPermissionClaimsDefaultSelector$' -count=1 -vgit diff --checkWhat Type of PR Is This?
/kind bug
Related Issue(s)
Backports #4200.
Release Notes