Skip to content

Commit 3e5e59b

Browse files
authored
fix: remove broken validation rule (#111)
1 parent 63d4153 commit 3e5e59b

File tree

3 files changed

+8
-24
lines changed

3 files changed

+8
-24
lines changed

api/common/oidc_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ type RoleBindings struct {
6363
RoleRefs []RoleRef `json:"roleRefs"`
6464
}
6565

66-
// +kubebuilder:validation:XValidation:rule="self.kind == 'Role' && has(self.namespace) && self.namespace != ”", message="namespace must be set if kind is 'Role'"
67-
// +kubebuilder:validation:XValidation:rule="self.kind == 'ClusterRole' && (!has(self.namespace) || self.namespace == ”)", message="namespace must not be set if kind is 'ClusterRole'"
66+
// RoleRef defines a reference to a (cluster) role that should be bound to the subjects.
67+
// TODO: Validate that Namespace is set if Kind is 'Role' and not set if Kind is 'ClusterRole'.
6868
type RoleRef struct {
6969
// Name is the name of the role or cluster role to bind to the subjects.
7070
// +kubebuilder:validation:MinLength=1

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ spec:
116116
RoleRefs is a list of (cluster) role references that the subjects should be bound to.
117117
Note that existence of the roles is not checked and missing (cluster) roles will result in ineffective (cluster) role bindings.
118118
items:
119+
description: RoleRef defines a reference to a (cluster)
120+
role that should be bound to the subjects.
119121
properties:
120122
kind:
121123
description: |-
@@ -139,13 +141,6 @@ spec:
139141
- kind
140142
- name
141143
type: object
142-
x-kubernetes-validations:
143-
- message: namespace must be set if kind is 'Role'
144-
rule: self.kind == 'Role' && has(self.namespace) &&
145-
self.namespace != ”
146-
- message: namespace must not be set if kind is 'ClusterRole'
147-
rule: self.kind == 'ClusterRole' && (!has(self.namespace)
148-
|| self.namespace == ”)
149144
type: array
150145
subjects:
151146
description: |-

api/crds/manifests/core.openmcp.cloud_managedcontrolplanev2s.yaml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ spec:
100100
RoleRefs is a list of (cluster) role references that the subjects should be bound to.
101101
Note that existence of the roles is not checked and missing (cluster) roles will result in ineffective (cluster) role bindings.
102102
items:
103+
description: RoleRef defines a reference to a (cluster)
104+
role that should be bound to the subjects.
103105
properties:
104106
kind:
105107
description: |-
@@ -123,14 +125,6 @@ spec:
123125
- kind
124126
- name
125127
type: object
126-
x-kubernetes-validations:
127-
- message: namespace must be set if kind is 'Role'
128-
rule: self.kind == 'Role' && has(self.namespace)
129-
&& self.namespace != ”
130-
- message: namespace must not be set if kind is
131-
'ClusterRole'
132-
rule: self.kind == 'ClusterRole' && (!has(self.namespace)
133-
|| self.namespace == ”)
134128
type: array
135129
subjects:
136130
description: |-
@@ -209,6 +203,8 @@ spec:
209203
RoleRefs is a list of (cluster) role references that the subjects should be bound to.
210204
Note that existence of the roles is not checked and missing (cluster) roles will result in ineffective (cluster) role bindings.
211205
items:
206+
description: RoleRef defines a reference to a (cluster)
207+
role that should be bound to the subjects.
212208
properties:
213209
kind:
214210
description: |-
@@ -232,13 +228,6 @@ spec:
232228
- kind
233229
- name
234230
type: object
235-
x-kubernetes-validations:
236-
- message: namespace must be set if kind is 'Role'
237-
rule: self.kind == 'Role' && has(self.namespace) &&
238-
self.namespace != ”
239-
- message: namespace must not be set if kind is 'ClusterRole'
240-
rule: self.kind == 'ClusterRole' && (!has(self.namespace)
241-
|| self.namespace == ”)
242231
type: array
243232
subjects:
244233
description: |-

0 commit comments

Comments
 (0)