You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api/v1alpha1/roleassignment_types.go
+30-70Lines changed: 30 additions & 70 deletions
Original file line number
Diff line number
Diff line change
@@ -16,129 +16,89 @@ limitations under the License.
16
16
17
17
package v1alpha1
18
18
19
-
// RoleAssignmentResourceSpec contains the desired state of the resource.
19
+
// RoleAssignmentResourceSpec defines the desired role assignment.
20
+
// A role assignment grants a role to a user or group on a project or domain.
21
+
// Role assignments are immutable once created and identified by the combination
22
+
// of (role, actor, scope) rather than a separate ID.
23
+
// +kubebuilder:validation:XValidation:rule="(has(self.userRef) && !has(self.groupRef)) || (!has(self.userRef) && has(self.groupRef))",message="exactly one of userRef or groupRef is required"
24
+
// +kubebuilder:validation:XValidation:rule="(has(self.projectRef) && !has(self.domainRef)) || (!has(self.projectRef) && has(self.domainRef))",message="exactly one of projectRef or domainRef is required"
25
+
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="RoleAssignmentResourceSpec is immutable"
20
26
typeRoleAssignmentResourceSpecstruct {
21
-
// name will be the name of the created resource. If not specified, the
22
-
// name of the ORC object will be used.
23
-
// +optional
24
-
Name*OpenStackName`json:"name,omitempty"`
25
-
26
-
// description is a human-readable description for the resource.
27
-
// +kubebuilder:validation:MinLength:=1
28
-
// +kubebuilder:validation:MaxLength:=255
29
-
// +optional
30
-
Description*string`json:"description,omitempty"`
31
-
32
-
// roleRef is a reference to the ORC Role which this resource is associated with.
27
+
// roleRef references the Role being assigned.
33
28
// +required
34
-
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="roleRef is immutable"
0 commit comments