Skip to content

Commit 2de1100

Browse files
feat: add RoleRefs to AccessRequest API (#128)
* feat: add `RoleRefs` to `AccessRequest` * feat: release v0.11.1
1 parent 6c88626 commit 2de1100

File tree

6 files changed

+42
-3
lines changed

6 files changed

+42
-3
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.11.0-dev
1+
v0.11.1

api/clusters/v1alpha1/accessrequest_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ type AccessRequestSpec struct {
3737
// +optional
3838
Permissions []PermissionsRequest `json:"permissions,omitempty"`
3939

40+
// RoleRefs are references to existing (Cluster)Roles that should be bound to the created serviceaccount or OIDC user.
41+
// +optional
42+
RoleRefs []commonapi.RoleRef `json:"roleRefs,omitempty"`
43+
4044
// OIDCProvider is a configuration for an OIDC provider that should be used for authentication and associated role bindings.
4145
// If set, the handling ClusterProvider will create an OIDC-based access for the AccessRequest, if supported.
4246
// Otherwise, a serviceaccount with a token will be created and bound to the requested permissions.

api/clusters/v1alpha1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/crds/manifests/clusters.openmcp.cloud_accessrequests.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,36 @@ spec:
295295
x-kubernetes-validations:
296296
- message: requestRef is immutable
297297
rule: self == oldSelf
298+
roleRefs:
299+
description: RoleRefs are references to existing (Cluster)Roles that
300+
should be bound to the created serviceaccount or OIDC user.
301+
items:
302+
description: RoleRef defines a reference to a (cluster) role that
303+
should be bound to the subjects.
304+
properties:
305+
kind:
306+
description: |-
307+
Kind is the kind of the role to bind to the subjects.
308+
It must be 'Role' or 'ClusterRole'.
309+
enum:
310+
- Role
311+
- ClusterRole
312+
type: string
313+
name:
314+
description: Name is the name of the role or cluster role to
315+
bind to the subjects.
316+
minLength: 1
317+
type: string
318+
namespace:
319+
description: |-
320+
Namespace is the namespace of the role to bind to the subjects.
321+
It must be set if the kind is 'Role' and may not be set if the kind is 'ClusterRole'.
322+
type: string
323+
required:
324+
- kind
325+
- name
326+
type: object
327+
type: array
298328
type: object
299329
x-kubernetes-validations:
300330
- message: clusterRef may not be removed once set

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/onsi/ginkgo/v2 v2.25.1
1212
github.com/onsi/gomega v1.38.1
1313
github.com/openmcp-project/controller-utils v0.18.0
14-
github.com/openmcp-project/openmcp-operator/api v0.11.0
14+
github.com/openmcp-project/openmcp-operator/api v0.11.1
1515
github.com/spf13/cobra v1.9.1
1616
k8s.io/api v0.33.4
1717
k8s.io/apimachinery v0.33.4

lib/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/onsi/ginkgo/v2 v2.25.1
99
github.com/onsi/gomega v1.38.1
1010
github.com/openmcp-project/controller-utils v0.18.0
11-
github.com/openmcp-project/openmcp-operator/api v0.11.0
11+
github.com/openmcp-project/openmcp-operator/api v0.11.1
1212
k8s.io/api v0.33.4
1313
k8s.io/apimachinery v0.33.4
1414
k8s.io/client-go v0.33.4

0 commit comments

Comments
 (0)