From 84f32f2478cecfd12bedc147b8e65245b3d045ed Mon Sep 17 00:00:00 2001 From: Francisc Munteanu Date: Mon, 18 Sep 2023 11:25:56 +0200 Subject: [PATCH] address PR comments --- api/v1alpha1/workspace_types.go | 3 ++- api/v1alpha1/zz_generated.openapi.go | 12 +++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/api/v1alpha1/workspace_types.go b/api/v1alpha1/workspace_types.go index d0b5617e..10997513 100644 --- a/api/v1alpha1/workspace_types.go +++ b/api/v1alpha1/workspace_types.go @@ -41,6 +41,7 @@ type WorkspaceStatus struct { type Binding struct { // MasterUserRecord is the name of the user that has access to the workspace. + // This field is immutable via a validating webhook. MasterUserRecord string `json:"masterUserRecord,omitempty"` // Role is the role of the user in the current workspace. For example "admin" for the user that has all permissions on the current workspace. @@ -50,7 +51,7 @@ type Binding struct { // Available values: // - "update" when the role in the current binding can be changed // - "delete" when the current binding can be deleted - // - "override" when the current binding can be overwritten by a new binding containing the same MasterUserRecord but a different role + // - "override" when the current binding is inherited from a parent workspace, it cannot be updated, but it can be overridden by creating a new binding containing the same MasterUserRecord but different role in the subworkspace. // +listType=atomic // +optional AvailableActions []string `json:"availableActions,omitempty"` diff --git a/api/v1alpha1/zz_generated.openapi.go b/api/v1alpha1/zz_generated.openapi.go index 4a06118e..93dadfc7 100644 --- a/api/v1alpha1/zz_generated.openapi.go +++ b/api/v1alpha1/zz_generated.openapi.go @@ -5024,6 +5024,11 @@ func schema_codeready_toolchain_api_api_v1alpha1_WorkspaceStatus(ref common.Refe }, }, "availableRoles": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "AvailableRoles contains the roles for this tier. For example, \"admin|contributor|maintainer\".", Type: []string{"array"}, @@ -5039,8 +5044,13 @@ func schema_codeready_toolchain_api_api_v1alpha1_WorkspaceStatus(ref common.Refe }, }, "bindings": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ - Description: "Bindings enumerates the permissions that have been granted to users within the current workspace, and actions that workspace admin users can apply to those permissions.", + Description: "Bindings enumerates the permissions that have been granted to users within the current workspace, and actions that can be applied to those permissions.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{