From 18493eae06c6759a5c915025d06e393040b62c22 Mon Sep 17 00:00:00 2001 From: Francisc Munteanu Date: Wed, 29 May 2024 11:51:05 +0200 Subject: [PATCH 1/2] update api version --- api/v1alpha1/zz_generated.openapi.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/v1alpha1/zz_generated.openapi.go b/api/v1alpha1/zz_generated.openapi.go index 0597c18d..182fe924 100644 --- a/api/v1alpha1/zz_generated.openapi.go +++ b/api/v1alpha1/zz_generated.openapi.go @@ -5213,7 +5213,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_WebhookConfig(ref common.Refere Properties: map[string]spec.Schema{ "deploy": { SchemaProps: spec.SchemaProps{ - Description: "Defines the flag that determines whether to deploy the Webhook. If the deploy flag is disabled, the Webhook is deployed and deleted immediately after by the memberoperatorconfig controller.", + Description: "Defines the flag that determines whether to deploy the Webhook. If the deploy flag is set to False and the Webhook was deployed previously it will be deleted by the memberoperatorconfig controller.", Type: []string{"boolean"}, Format: "", }, From a24a5d454de5e1c54a74fb93bd484b35216d1f3f Mon Sep 17 00:00:00 2001 From: Devtools Date: Thu, 28 Nov 2024 14:35:39 +0100 Subject: [PATCH 2/2] add parameters in TierTemplateRevision --- api/v1alpha1/docs/apiref.adoc | 2 ++ api/v1alpha1/tiertemplaterevision_types.go | 8 +++++++ api/v1alpha1/zz_generated.deepcopy.go | 5 +++++ api/v1alpha1/zz_generated.openapi.go | 26 +++++++++++++++++++++- 4 files changed, 40 insertions(+), 1 deletion(-) diff --git a/api/v1alpha1/docs/apiref.adoc b/api/v1alpha1/docs/apiref.adoc index b47eeb1b..6dbfe20f 100644 --- a/api/v1alpha1/docs/apiref.adoc +++ b/api/v1alpha1/docs/apiref.adoc @@ -1893,6 +1893,7 @@ TierTemplate creation. .Appears In: **** - xref:{anchor_prefix}-github-com-codeready-toolchain-api-api-v1alpha1-nstemplatetierspec[$$NSTemplateTierSpec$$] +- xref:{anchor_prefix}-github-com-codeready-toolchain-api-api-v1alpha1-tiertemplaterevisionspec[$$TierTemplateRevisionSpec$$] **** [cols="20a,50a,15a,15a", options="header"] @@ -3207,6 +3208,7 @@ TierTemplateRevisionSpec defines the desired state of TierTemplateRevision | Field | Description | Default | Validation | *`templateObjects`* __link:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#rawextension-runtime-pkg[$$RawExtension$$] array__ | TemplateObjects contains list of Unstructured Objects that can be parsed at runtime and will be applied as part of the tier provisioning. + The template parameters values will be defined in the NSTemplateTier CRD. + | | +| *`parameters`* __xref:{anchor_prefix}-github-com-codeready-toolchain-api-api-v1alpha1-parameter[$$Parameter$$] array__ | Parameters is an optional array of Parameters which will be used to replace the variables present in the TemplateObjects list when provisioning a Space. + | | |=== diff --git a/api/v1alpha1/tiertemplaterevision_types.go b/api/v1alpha1/tiertemplaterevision_types.go index b490b60d..868d5104 100644 --- a/api/v1alpha1/tiertemplaterevision_types.go +++ b/api/v1alpha1/tiertemplaterevision_types.go @@ -29,6 +29,14 @@ type TierTemplateRevisionSpec struct { // +listType=atomic // +kubebuilder:pruning:PreserveUnknownFields TemplateObjects []runtime.RawExtension `json:"templateObjects,omitempty" protobuf:"bytes,3,opt,name=templateObjects"` + + // Parameters is an optional array of Parameters which will be used to replace the variables present in the TemplateObjects list when provisioning a Space. + // +optional + // +patchMergeKey=name + // +patchStrategy=merge + // +listType=map + // +listMapKey=name + Parameters []Parameter `json:"parameters,omitempty" protobuf:"bytes,4,opt,name=parameters" patchStrategy:"merge" patchMergeKey:"name"` } //+kubebuilder:object:root=true diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 02a33a55..ffb8d19d 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -3156,6 +3156,11 @@ func (in *TierTemplateRevisionSpec) DeepCopyInto(out *TierTemplateRevisionSpec) (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]Parameter, len(*in)) + copy(*out, *in) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TierTemplateRevisionSpec. diff --git a/api/v1alpha1/zz_generated.openapi.go b/api/v1alpha1/zz_generated.openapi.go index 36328e21..5441bc23 100644 --- a/api/v1alpha1/zz_generated.openapi.go +++ b/api/v1alpha1/zz_generated.openapi.go @@ -4374,11 +4374,35 @@ func schema_codeready_toolchain_api_api_v1alpha1_TierTemplateRevisionSpec(ref co }, }, }, + "parameters": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "name", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Parameters is an optional array of Parameters which will be used to replace the variables present in the TemplateObjects list when provisioning a Space.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Parameter"), + }, + }, + }, + }, + }, }, }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/runtime.RawExtension"}, + "github.com/codeready-toolchain/api/api/v1alpha1.Parameter", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, } }