From acdc61b014c8af38579cf30aac96de9a01f50309 Mon Sep 17 00:00:00 2001 From: Kartikey Mamgain Date: Tue, 17 Oct 2023 17:00:33 +0530 Subject: [PATCH] ASC-402: Modify NSTemplateTierSpec to support SA token copy (#380) * modify NSTemplateTierSpec Signed-off-by: Kartikey Mamgain * update nstemplatetier CRD Signed-off-by: Kartikey Mamgain * update NSTemplateTierSpec Signed-off-by: Kartikey Mamgain * modify test to use docker config Signed-off-by: Kartikey Mamgain * update nstemplatetier spec Signed-off-by: Kartikey Mamgain * Modify NSTemplateTierSpec to support SA token copy Signed-off-by: Kartikey Mamgain * update NSTemplateTier CRD Signed-off-by: Kartikey Mamgain * update NSTemplateTier CRD Signed-off-by: Kartikey Mamgain --------- Signed-off-by: Kartikey Mamgain --- .DS_Store | Bin 6148 -> 0 bytes api/v1alpha1/nstemplatetier_types.go | 12 +++++++++++ api/v1alpha1/zz_generated.deepcopy.go | 20 ++++++++++++++++++ api/v1alpha1/zz_generated.openapi.go | 29 +++++++++++++++++++++++++- 4 files changed, 60 insertions(+), 1 deletion(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index f21c584a3de86108a7f6392ef1f9d53e1e6ac776..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKOHRWu5Pc>ADk?rpHb^-^C2kN(vp@nC^Z?KgttwK21eIWyJ$K*=oR1Z}u`Luk zummAA6WPz7H)GF}62|~ce>FV>_5gHP1k){6Uzp5GY1x_|*(Dl@QBB5WHD*u3si^|0 zz+YED-rWQv++lH22Ji0?XL|3}Y!V5^Sl~8dy+*8cvR34kn1)Pq5HS->uxzoOBi064 z6>c$O%y|^?t;L<kbR*yTV;ypkze`#dC0mr>(X3H=xB>yIN+j3`& z`+!UC=8^j^>BpUgo>q^h=O#{Zf@2go#}Gxt7G0X`lq-yI(~2sZG zI#=Vb7{=cnjC1FF?)kMt=MH06W*on=@i!FXuO23|beP6fo&vIOsDaf3~)gle0EsxndC$UhUAju=2;TZOBo)&ti>pnKX#G$J!xB QX!;{yWzb3$_*Dfy084qsn*aa+ diff --git a/api/v1alpha1/nstemplatetier_types.go b/api/v1alpha1/nstemplatetier_types.go index 1ea048f3..164c6194 100644 --- a/api/v1alpha1/nstemplatetier_types.go +++ b/api/v1alpha1/nstemplatetier_types.go @@ -22,6 +22,18 @@ type NSTemplateTierSpec struct { // +optional // +mapType=atomic SpaceRoles map[string]NSTemplateTierSpaceRole `json:"spaceRoles,omitempty"` + + // SpaceRequestConfig stores all the configuration related to the Space Request feature + // +optional + SpaceRequestConfig *SpaceRequestConfig `json:"spaceRequestConfig,omitempty"` +} + +// SpaceRequestConfig contains all the configuration related to the Space Request feature +// +k8s:openapi-gen=true +type SpaceRequestConfig struct { + // Provides the name of the Service Account whose token is to be copied + // +optional + ServiceAccountName string `json:"serviceAccountName,omitempty"` } // NSTemplateTierNamespace the namespace definition in an NSTemplateTier resource diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 33a5fc5d..18b86f05 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -1508,6 +1508,11 @@ func (in *NSTemplateTierSpec) DeepCopyInto(out *NSTemplateTierSpec) { (*out)[key] = val } } + if in.SpaceRequestConfig != nil { + in, out := &in.SpaceRequestConfig, &out.SpaceRequestConfig + *out = new(SpaceRequestConfig) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NSTemplateTierSpec. @@ -2673,6 +2678,21 @@ func (in *SpaceRequest) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SpaceRequestConfig) DeepCopyInto(out *SpaceRequestConfig) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SpaceRequestConfig. +func (in *SpaceRequestConfig) DeepCopy() *SpaceRequestConfig { + if in == nil { + return nil + } + out := new(SpaceRequestConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SpaceRequestList) DeepCopyInto(out *SpaceRequestList) { *out = *in diff --git a/api/v1alpha1/zz_generated.openapi.go b/api/v1alpha1/zz_generated.openapi.go index 230e1f21..285dd454 100644 --- a/api/v1alpha1/zz_generated.openapi.go +++ b/api/v1alpha1/zz_generated.openapi.go @@ -106,6 +106,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/codeready-toolchain/api/api/v1alpha1.SpaceBindingStatus": schema_codeready_toolchain_api_api_v1alpha1_SpaceBindingStatus(ref), "github.com/codeready-toolchain/api/api/v1alpha1.SpaceConfig": schema_codeready_toolchain_api_api_v1alpha1_SpaceConfig(ref), "github.com/codeready-toolchain/api/api/v1alpha1.SpaceRequest": schema_codeready_toolchain_api_api_v1alpha1_SpaceRequest(ref), + "github.com/codeready-toolchain/api/api/v1alpha1.SpaceRequestConfig": schema_codeready_toolchain_api_api_v1alpha1_SpaceRequestConfig(ref), "github.com/codeready-toolchain/api/api/v1alpha1.SpaceRequestSpec": schema_codeready_toolchain_api_api_v1alpha1_SpaceRequestSpec(ref), "github.com/codeready-toolchain/api/api/v1alpha1.SpaceRequestStatus": schema_codeready_toolchain_api_api_v1alpha1_SpaceRequestStatus(ref), "github.com/codeready-toolchain/api/api/v1alpha1.SpaceSpec": schema_codeready_toolchain_api_api_v1alpha1_SpaceSpec(ref), @@ -2075,12 +2076,18 @@ func schema_codeready_toolchain_api_api_v1alpha1_NSTemplateTierSpec(ref common.R }, }, }, + "spaceRequestConfig": { + SchemaProps: spec.SchemaProps{ + Description: "SpaceRequestConfig stores all the configuration related to the Space Request feature", + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.SpaceRequestConfig"), + }, + }, }, Required: []string{"namespaces"}, }, }, Dependencies: []string{ - "github.com/codeready-toolchain/api/api/v1alpha1.NSTemplateTierClusterResources", "github.com/codeready-toolchain/api/api/v1alpha1.NSTemplateTierNamespace", "github.com/codeready-toolchain/api/api/v1alpha1.NSTemplateTierSpaceRole"}, + "github.com/codeready-toolchain/api/api/v1alpha1.NSTemplateTierClusterResources", "github.com/codeready-toolchain/api/api/v1alpha1.NSTemplateTierNamespace", "github.com/codeready-toolchain/api/api/v1alpha1.NSTemplateTierSpaceRole", "github.com/codeready-toolchain/api/api/v1alpha1.SpaceRequestConfig"}, } } @@ -3698,6 +3705,26 @@ func schema_codeready_toolchain_api_api_v1alpha1_SpaceRequest(ref common.Referen } } +func schema_codeready_toolchain_api_api_v1alpha1_SpaceRequestConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "SpaceRequestConfig contains all the configuration related to the Space Request feature", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "serviceAccountName": { + SchemaProps: spec.SchemaProps{ + Description: "Provides the name of the Service Account whose token is to be copied", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + func schema_codeready_toolchain_api_api_v1alpha1_SpaceRequestSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{