Repository navigation
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/build-image |
Claimed custom subresources are authorized by the APIExport VW but never served through itTested this branch ( The cross-provider case has a gap, though. Setup:
Through B's APIExport virtual workspace (
Why: the claim is accepted by the authorizer but nothing builds an API behind it.
So a claim on a custom subresource is a declaration with nothing behind it. The practical consequence is that the only way for B to call A's verb today is the shard path Ask: for a claimed (and own) Related question (identity on that hop): when the request arrives at A's endpoint via B's VW, A sees Happy to turn the first part into a failing e2e in |
|
/build-image |
ba9e0a6 to
4688fe6
Compare
|
/build-image |
An identity-agnostic claim on a resource served from a ClusterCachedResource is authorized and discoverable, but always lists emptyFollow-up from the same setup, tested against this branch's head ( Setup:
Observed through B's APIExport virtual workspace,
The objects are definitely there and definitely reachable by other routes: the consumer sees 8 Templates through its own binding to A, and A's own APIExport VW returns the same 8 for that consumer workspace. Reading the shard path directly as B's ServiceAccount is a clean 403, so this is not RBAC leaking through as an empty result. Why, as far as the code goes. For // pkg/permissionclaim/identity.go:182
if bound.Group != gr.Group || bound.Resource != gr.Resource || bound.Schema.IdentityHash == "" {
continue
}
return ClaimedIdentity{IdentityHash: bound.Schema.IdentityHash, ...}For a kind backed by a cached resource those are two different identities:
Exactly one hash comes back, so per That last link is read from the code rather than observed: the identity-suffixed form is refused for an ordinary admin token, so I could not probe Ask. Two parts, and the second matters more than the first:
Happy to turn this into a failing e2e in |
|
Correcting myself on the comment above: the identity story is wrong, and the defect is broader than I described. Two checks settled it. 1. The objects carry no claim label. Same consumer workspace, both kinds claimed and accepted by the same export: 2. Pinning the claim to an explicit So nothing in The actual mechanism is the claim label selector. For a claimed resource the VW builds a label requirement and filters every read through it:
Replicated objects never get labelled, so the selector matches nothing and the read is correct-but-empty. That is consistent with everything observed, including why a A better title for this would be: a permission claim on a resource its producing APIExport serves from a ClusterCachedResource is authorized and discoverable, but always reads empty, because the claim labeler never labels replicated objects. The ask changes shape accordingly. Either the labeler has to cover replicated resources, or, if labelling a cached object is not meaningful (it is a copy, and the label is keyed by the consumer cluster and claiming export), the claimed read for such a kind needs to skip the label selector and be scoped some other way. What should not survive either way is the silent empty list: admission knows at claim time that the producing entry uses |
No, and that is worth stating in the PR, because it is already the case. The consumer binding's claim on the cached kind is The reason is that the selector never reaches the decision. var labelReqs labels.Requirements
if c, ok := claims[gvr.GroupResource()]; ok {
key, label, err := permissionclaims.ToLabelKeyAndValue(clusterName, apiExport.Name, c)
...
req, err := labels.NewRequirement(key, selection.In, claimLabels)
...
labelReqs = labels.Requirements{*req}
}
Also confirming the API point, since it is load-bearing for stating the rule: the xor is already enforced, not just conventional. And agreed that labelling replicas is the wrong direction, for the reason you give: the label key is derived from the consumer cluster and the claiming export, while the cache holds one copy shared by every consumer, so there is no single correct value to write even if the replication storage were writable. I will put up the failing e2e in |
|
/build-image |
2 similar comments
|
/build-image |
|
/build-image |
|
/build-image |
20f1d30 to
644055b
Compare
|
/build-image |
2 similar comments
|
/build-image |
|
/build-image |
9112779 to
9790f69
Compare
|
/build-image |
|
/test all |
|
@mjudeikis: The following tests failed, say
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. I understand the commands that are listed here. |
|
PR needs rebase. 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. |
Summary
What Type of PR Is This?
Related Issue(s)
Fixes #
Release Notes