-
Notifications
You must be signed in to change notification settings - Fork 417
Move permission claim object selectors from APIExport to APIBinding #3486
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
Conversation
Skipping CI for Draft Pull Request. |
c63a31f
to
17cf504
Compare
17cf504
to
1f528c8
Compare
/hold Since I want to discuss this PR with @xmudrii. |
08aff20
to
6e05872
Compare
/retest |
…ding On-behalf-of: SAP <marvin.beckers@sap.com> Signed-off-by: Marvin Beckers <marvin@kubermatic.com>
6e05872
to
f4fc17b
Compare
On-behalf-of: SAP <marvin.beckers@sap.com> Signed-off-by: Marvin Beckers <marvin@kubermatic.com>
On-behalf-of: SAP <marvin.beckers@sap.com> Signed-off-by: Marvin Beckers <marvin@kubermatic.com>
Signed-off-by: Marvin Beckers <marvin@kubermatic.com>
Signed-off-by: Marvin Beckers <marvin@kubermatic.com>
f4fc17b
to
e35699e
Compare
v2obj := v2.(*APIExport) | ||
delete(v2obj.Annotations, PermissionClaimsV1Alpha1Annotation) | ||
if len(v2obj.Annotations) == 0 { | ||
v2obj.Annotations = nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine, but we should have a quick test to make sure the behavior around this annotation is correct.
LGTM label has been added. Git tree hash: 083c7f231252d207ecee3f1cdf903dfcec7ebed2
|
/hold I think this is wrong. This moves permission claim responsibility to APIBinding from APIExport. This means that now you can have a need to check " accepted claims and state of them" on each binding. This will put big operational strain on the provider. Meaning on each reconcile loop provider needs to check what is the state of APIBinding and adjust reconciler for this. If user says 'selector=label=foo' provider will need to inject this. |
/hold cancel |
On-behalf-of: SAP <marvin.beckers@sap.com> Signed-off-by: Marvin Beckers <marvin@kubermatic.com>
On-behalf-of: SAP <marvin.beckers@sap.com> Signed-off-by: Marvin Beckers <marvin@kubermatic.com>
/retest |
/retest Known flake: #3444 |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: xmudrii, xrstf 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 |
/lgtm |
LGTM label has been added. Git tree hash: 3b2c2de7032b7d7600be6f7f2c70694e46d26128
|
Summary
This PR implements the API changes we wanted to get into
v1alpha2
before we cut the release solidifying the API version. It's been mainly discussed on Slack: https://kubernetes.slack.com/archives/C021U8WSAFK/p1749552577773639. I don't think a strong consensus has been reached but the general direction is what this PR proposes.It removes the
all
andresourceSelector
fields from thePermissionClaim
type (i.e. remove the object selector configuration from theAPIExport
on the service provider side). It instead adds aselector
field inAcceptablePermissionClaim
(the wrapper type used for permission claims inAPIBindings
) which allows the API consumer to scope access of an API provider to a specific resource.Conversions have been added so that if a permission claim in an
APIBinding
hadall: true
, it would automatically translate intoselector.matchAll: true
(and back). To allow API roundtripping without loss of information, permission claims are now stored in an annotation when converting from v1alpha1 to v1alpha2, so thatresourceSelector
can be restored upon converting back to v1alpha1.A few more things this PR does:
APIExport
andAPIBindings
across the code base.v1alpha2
package into two files.PermissionClaim.Equal
toPermissionClaim.EqualGRI
.Equal
is used bycmp
to compare objects, so (acceptable) permission claims were only compared partially, which shadowed some bugs in my code early on.What Type of PR Is This?
/kind cleanup
/kind api-change
Related Issue(s)
Fixes #3456
Release Notes