From 484e275175ce7f1c02c588c5c4abeb308f09d6bf Mon Sep 17 00:00:00 2001 From: Rana Tarek Hassan Date: Tue, 10 Jan 2023 17:23:28 +0200 Subject: [PATCH 1/8] Add path support to profile chartspec Regenerate crds --- apis/core/templates.go | 12 ++++++++ apis/core/zz_generated.deepcopy.go | 16 +++++++++++ .../bases/capi.weave.works_capitemplates.yaml | 28 ++++++++++++++++--- ...templates.weave.works_gitopstemplates.yaml | 28 ++++++++++++++++--- 4 files changed, 76 insertions(+), 8 deletions(-) diff --git a/apis/core/templates.go b/apis/core/templates.go index c9f2e9b..4c6b5ff 100644 --- a/apis/core/templates.go +++ b/apis/core/templates.go @@ -97,7 +97,17 @@ type Chart struct { // Shortcut to template.content.spec.values Values *HelmReleaseValues `json:"values,omitempty"` // Template for the HelmRelease, merged with the default template + // Shortcut to template.content.spec.chart.spec.template HelmReleaseTemplate HelmReleaseTemplateSpec `json:"template,omitempty"` + // Template for the HelmRepository + // Shortcut to template.content.spec.chart.spec.helmRepositoryTemplate + HelmRepositoryTemplate HelmRepositoryTemplateSpec `json:"helmRepositoryTemplate,omitempty"` +} + +// HelmRepositoryTemplateSpec is a future proof way to define a template with a path +// +kubebuilder:object:generate=true +type HelmRepositoryTemplateSpec struct { + Path string `json:"path,omitempty"` } // HelmReleaseTemplateSpec is a future proof way to define a template with a path @@ -122,6 +132,8 @@ type ResourceTemplate struct { // +kubebuilder:pruning:PreserveUnknownFields type HelmReleaseTemplate struct { runtime.RawExtension `json:",inline"` + // Path of the template + Path string `json:"path,omitempty"` } // HelmReleaseValues describes the values for a profile. diff --git a/apis/core/zz_generated.deepcopy.go b/apis/core/zz_generated.deepcopy.go index b6a0527..a09b812 100644 --- a/apis/core/zz_generated.deepcopy.go +++ b/apis/core/zz_generated.deepcopy.go @@ -32,6 +32,7 @@ func (in *Chart) DeepCopyInto(out *Chart) { (*in).DeepCopyInto(*out) } in.HelmReleaseTemplate.DeepCopyInto(&out.HelmReleaseTemplate) + out.HelmRepositoryTemplate = in.HelmRepositoryTemplate } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Chart. @@ -118,6 +119,21 @@ func (in *HelmReleaseValues) DeepCopy() *HelmReleaseValues { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HelmRepositoryTemplateSpec) DeepCopyInto(out *HelmRepositoryTemplateSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmRepositoryTemplateSpec. +func (in *HelmRepositoryTemplateSpec) DeepCopy() *HelmRepositoryTemplateSpec { + if in == nil { + return nil + } + out := new(HelmRepositoryTemplateSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ResourceTemplate) DeepCopyInto(out *ResourceTemplate) { *out = *in diff --git a/config/crd/bases/capi.weave.works_capitemplates.yaml b/config/crd/bases/capi.weave.works_capitemplates.yaml index 329ed2c..839ddd6 100644 --- a/config/crd/bases/capi.weave.works_capitemplates.yaml +++ b/config/crd/bases/capi.weave.works_capitemplates.yaml @@ -52,6 +52,13 @@ spec: description: If true you can change the values and version of the chart/profile type: boolean + helmRepositoryTemplate: + description: Template for the HelmRepository Shortcut to + template.content.spec.chart.spec.helmRepositoryTemplate + properties: + path: + type: string + type: object layer: description: Layer, overrides the default layer provided in the Helm Repository @@ -64,10 +71,14 @@ spec: type: string template: description: Template for the HelmRelease, merged with the - default template + default template Shortcut to template.content.spec.chart.spec.template properties: content: description: Content of the template + properties: + path: + description: Path of the template + type: string type: object x-kubernetes-preserve-unknown-fields: true type: object @@ -172,6 +183,13 @@ spec: description: If true you can change the values and version of the chart/profile type: boolean + helmRepositoryTemplate: + description: Template for the HelmRepository Shortcut to + template.content.spec.chart.spec.helmRepositoryTemplate + properties: + path: + type: string + type: object layer: description: Layer, overrides the default layer provided in the Helm Repository @@ -184,10 +202,14 @@ spec: type: string template: description: Template for the HelmRelease, merged with the - default template + default template Shortcut to template.content.spec.chart.spec.template properties: content: description: Content of the template + properties: + path: + description: Path of the template + type: string type: object x-kubernetes-preserve-unknown-fields: true type: object @@ -259,8 +281,6 @@ spec: type: array path: type: string - required: - - content type: object type: array type: object diff --git a/config/crd/bases/templates.weave.works_gitopstemplates.yaml b/config/crd/bases/templates.weave.works_gitopstemplates.yaml index 4be6593..03d4eca 100644 --- a/config/crd/bases/templates.weave.works_gitopstemplates.yaml +++ b/config/crd/bases/templates.weave.works_gitopstemplates.yaml @@ -52,6 +52,13 @@ spec: description: If true you can change the values and version of the chart/profile type: boolean + helmRepositoryTemplate: + description: Template for the HelmRepository Shortcut to + template.content.spec.chart.spec.helmRepositoryTemplate + properties: + path: + type: string + type: object layer: description: Layer, overrides the default layer provided in the Helm Repository @@ -64,10 +71,14 @@ spec: type: string template: description: Template for the HelmRelease, merged with the - default template + default template Shortcut to template.content.spec.chart.spec.template properties: content: description: Content of the template + properties: + path: + description: Path of the template + type: string type: object x-kubernetes-preserve-unknown-fields: true type: object @@ -174,6 +185,13 @@ spec: description: If true you can change the values and version of the chart/profile type: boolean + helmRepositoryTemplate: + description: Template for the HelmRepository Shortcut to + template.content.spec.chart.spec.helmRepositoryTemplate + properties: + path: + type: string + type: object layer: description: Layer, overrides the default layer provided in the Helm Repository @@ -186,10 +204,14 @@ spec: type: string template: description: Template for the HelmRelease, merged with the - default template + default template Shortcut to template.content.spec.chart.spec.template properties: content: description: Content of the template + properties: + path: + description: Path of the template + type: string type: object x-kubernetes-preserve-unknown-fields: true type: object @@ -261,8 +283,6 @@ spec: type: array path: type: string - required: - - content type: object type: array type: object From ac5cafdddf7fe1d38924df5ac5bac616e67e4e79 Mon Sep 17 00:00:00 2001 From: Rana Tarek Hassan Date: Thu, 12 Jan 2023 15:50:51 +0200 Subject: [PATCH 2/8] Update HelmRepositoryTemplate in charts spec of templates --- apis/core/templates.go | 8 ++--- apis/core/zz_generated.deepcopy.go | 2 +- .../bases/capi.weave.works_capitemplates.yaml | 34 +++++++------------ ...templates.weave.works_gitopstemplates.yaml | 34 +++++++------------ 4 files changed, 28 insertions(+), 50 deletions(-) diff --git a/apis/core/templates.go b/apis/core/templates.go index 4c6b5ff..8f6efd7 100644 --- a/apis/core/templates.go +++ b/apis/core/templates.go @@ -74,6 +74,9 @@ type TemplateParam struct { type ChartsSpec struct { Items []Chart `json:"items,omitempty"` + // Template for the HelmRepository + // Shortcut to template.content.spec.chart.spec.helmRepositoryTemplate + HelmRepositoryTemplate HelmRepositoryTemplateSpec `json:"helmRepositoryTemplate,omitempty"` } // Chart is the set of values that control the default and required values @@ -99,9 +102,6 @@ type Chart struct { // Template for the HelmRelease, merged with the default template // Shortcut to template.content.spec.chart.spec.template HelmReleaseTemplate HelmReleaseTemplateSpec `json:"template,omitempty"` - // Template for the HelmRepository - // Shortcut to template.content.spec.chart.spec.helmRepositoryTemplate - HelmRepositoryTemplate HelmRepositoryTemplateSpec `json:"helmRepositoryTemplate,omitempty"` } // HelmRepositoryTemplateSpec is a future proof way to define a template with a path @@ -132,8 +132,6 @@ type ResourceTemplate struct { // +kubebuilder:pruning:PreserveUnknownFields type HelmReleaseTemplate struct { runtime.RawExtension `json:",inline"` - // Path of the template - Path string `json:"path,omitempty"` } // HelmReleaseValues describes the values for a profile. diff --git a/apis/core/zz_generated.deepcopy.go b/apis/core/zz_generated.deepcopy.go index a09b812..3bd216c 100644 --- a/apis/core/zz_generated.deepcopy.go +++ b/apis/core/zz_generated.deepcopy.go @@ -32,7 +32,6 @@ func (in *Chart) DeepCopyInto(out *Chart) { (*in).DeepCopyInto(*out) } in.HelmReleaseTemplate.DeepCopyInto(&out.HelmReleaseTemplate) - out.HelmRepositoryTemplate = in.HelmRepositoryTemplate } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Chart. @@ -55,6 +54,7 @@ func (in *ChartsSpec) DeepCopyInto(out *ChartsSpec) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + out.HelmRepositoryTemplate = in.HelmRepositoryTemplate } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChartsSpec. diff --git a/config/crd/bases/capi.weave.works_capitemplates.yaml b/config/crd/bases/capi.weave.works_capitemplates.yaml index 839ddd6..4d5a57b 100644 --- a/config/crd/bases/capi.weave.works_capitemplates.yaml +++ b/config/crd/bases/capi.weave.works_capitemplates.yaml @@ -39,6 +39,12 @@ spec: charts: description: Charts is the set of charts that are used in this template. properties: + helmRepositoryTemplate: + description: Template for the HelmRepository Shortcut to template.content.spec.chart.spec.helmRepositoryTemplate + properties: + path: + type: string + type: object items: items: description: Chart is the set of values that control the default @@ -52,13 +58,6 @@ spec: description: If true you can change the values and version of the chart/profile type: boolean - helmRepositoryTemplate: - description: Template for the HelmRepository Shortcut to - template.content.spec.chart.spec.helmRepositoryTemplate - properties: - path: - type: string - type: object layer: description: Layer, overrides the default layer provided in the Helm Repository @@ -75,10 +74,6 @@ spec: properties: content: description: Content of the template - properties: - path: - description: Path of the template - type: string type: object x-kubernetes-preserve-unknown-fields: true type: object @@ -170,6 +165,12 @@ spec: charts: description: Charts is the set of charts that are used in this template. properties: + helmRepositoryTemplate: + description: Template for the HelmRepository Shortcut to template.content.spec.chart.spec.helmRepositoryTemplate + properties: + path: + type: string + type: object items: items: description: Chart is the set of values that control the default @@ -183,13 +184,6 @@ spec: description: If true you can change the values and version of the chart/profile type: boolean - helmRepositoryTemplate: - description: Template for the HelmRepository Shortcut to - template.content.spec.chart.spec.helmRepositoryTemplate - properties: - path: - type: string - type: object layer: description: Layer, overrides the default layer provided in the Helm Repository @@ -206,10 +200,6 @@ spec: properties: content: description: Content of the template - properties: - path: - description: Path of the template - type: string type: object x-kubernetes-preserve-unknown-fields: true type: object diff --git a/config/crd/bases/templates.weave.works_gitopstemplates.yaml b/config/crd/bases/templates.weave.works_gitopstemplates.yaml index 03d4eca..317cae5 100644 --- a/config/crd/bases/templates.weave.works_gitopstemplates.yaml +++ b/config/crd/bases/templates.weave.works_gitopstemplates.yaml @@ -39,6 +39,12 @@ spec: charts: description: Charts is the set of charts that are used in this template. properties: + helmRepositoryTemplate: + description: Template for the HelmRepository Shortcut to template.content.spec.chart.spec.helmRepositoryTemplate + properties: + path: + type: string + type: object items: items: description: Chart is the set of values that control the default @@ -52,13 +58,6 @@ spec: description: If true you can change the values and version of the chart/profile type: boolean - helmRepositoryTemplate: - description: Template for the HelmRepository Shortcut to - template.content.spec.chart.spec.helmRepositoryTemplate - properties: - path: - type: string - type: object layer: description: Layer, overrides the default layer provided in the Helm Repository @@ -75,10 +74,6 @@ spec: properties: content: description: Content of the template - properties: - path: - description: Path of the template - type: string type: object x-kubernetes-preserve-unknown-fields: true type: object @@ -172,6 +167,12 @@ spec: charts: description: Charts is the set of charts that are used in this template. properties: + helmRepositoryTemplate: + description: Template for the HelmRepository Shortcut to template.content.spec.chart.spec.helmRepositoryTemplate + properties: + path: + type: string + type: object items: items: description: Chart is the set of values that control the default @@ -185,13 +186,6 @@ spec: description: If true you can change the values and version of the chart/profile type: boolean - helmRepositoryTemplate: - description: Template for the HelmRepository Shortcut to - template.content.spec.chart.spec.helmRepositoryTemplate - properties: - path: - type: string - type: object layer: description: Layer, overrides the default layer provided in the Helm Repository @@ -208,10 +202,6 @@ spec: properties: content: description: Content of the template - properties: - path: - description: Path of the template - type: string type: object x-kubernetes-preserve-unknown-fields: true type: object From 9ca494aa09ec3cc36cace85046b8cc541dbff284 Mon Sep 17 00:00:00 2001 From: Rana Tarek Hassan Date: Thu, 12 Jan 2023 17:38:37 +0200 Subject: [PATCH 3/8] Update HelmReleaseTemplate in charts spec of templates with path --- apis/core/templates.go | 2 ++ config/crd/bases/capi.weave.works_capitemplates.yaml | 8 ++++++++ .../crd/bases/templates.weave.works_gitopstemplates.yaml | 8 ++++++++ 3 files changed, 18 insertions(+) diff --git a/apis/core/templates.go b/apis/core/templates.go index 8f6efd7..c5a971c 100644 --- a/apis/core/templates.go +++ b/apis/core/templates.go @@ -132,6 +132,8 @@ type ResourceTemplate struct { // +kubebuilder:pruning:PreserveUnknownFields type HelmReleaseTemplate struct { runtime.RawExtension `json:",inline"` + // Path of the template + Path string `json:"path,omitempty"` } // HelmReleaseValues describes the values for a profile. diff --git a/config/crd/bases/capi.weave.works_capitemplates.yaml b/config/crd/bases/capi.weave.works_capitemplates.yaml index 4d5a57b..8cb3ca1 100644 --- a/config/crd/bases/capi.weave.works_capitemplates.yaml +++ b/config/crd/bases/capi.weave.works_capitemplates.yaml @@ -74,6 +74,10 @@ spec: properties: content: description: Content of the template + properties: + path: + description: Path of the template + type: string type: object x-kubernetes-preserve-unknown-fields: true type: object @@ -200,6 +204,10 @@ spec: properties: content: description: Content of the template + properties: + path: + description: Path of the template + type: string type: object x-kubernetes-preserve-unknown-fields: true type: object diff --git a/config/crd/bases/templates.weave.works_gitopstemplates.yaml b/config/crd/bases/templates.weave.works_gitopstemplates.yaml index 317cae5..a7394d2 100644 --- a/config/crd/bases/templates.weave.works_gitopstemplates.yaml +++ b/config/crd/bases/templates.weave.works_gitopstemplates.yaml @@ -74,6 +74,10 @@ spec: properties: content: description: Content of the template + properties: + path: + description: Path of the template + type: string type: object x-kubernetes-preserve-unknown-fields: true type: object @@ -202,6 +206,10 @@ spec: properties: content: description: Content of the template + properties: + path: + description: Path of the template + type: string type: object x-kubernetes-preserve-unknown-fields: true type: object From 6ab0ea2b2d185e1b9bab16fc39a35a792f78fab6 Mon Sep 17 00:00:00 2001 From: Rana Tarek Hassan Date: Sun, 15 Jan 2023 17:09:55 +0200 Subject: [PATCH 4/8] Update path to HelmReleaseTemplateSpec instead of HelmReleaseTemplate --- apis/core/templates.go | 4 ++-- .../crd/bases/capi.weave.works_capitemplates.yaml | 14 ++++++-------- .../templates.weave.works_gitopstemplates.yaml | 14 ++++++-------- 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/apis/core/templates.go b/apis/core/templates.go index c5a971c..0b0f464 100644 --- a/apis/core/templates.go +++ b/apis/core/templates.go @@ -114,6 +114,8 @@ type HelmRepositoryTemplateSpec struct { // path is not yet used, but will be used in the near future // +kubebuilder:object:generate=true type HelmReleaseTemplateSpec struct { + // Path of the template + Path string `json:"path,omitempty"` // Content of the template Content *HelmReleaseTemplate `json:"content,omitempty"` } @@ -132,8 +134,6 @@ type ResourceTemplate struct { // +kubebuilder:pruning:PreserveUnknownFields type HelmReleaseTemplate struct { runtime.RawExtension `json:",inline"` - // Path of the template - Path string `json:"path,omitempty"` } // HelmReleaseValues describes the values for a profile. diff --git a/config/crd/bases/capi.weave.works_capitemplates.yaml b/config/crd/bases/capi.weave.works_capitemplates.yaml index 8cb3ca1..a4abbbb 100644 --- a/config/crd/bases/capi.weave.works_capitemplates.yaml +++ b/config/crd/bases/capi.weave.works_capitemplates.yaml @@ -74,12 +74,11 @@ spec: properties: content: description: Content of the template - properties: - path: - description: Path of the template - type: string type: object x-kubernetes-preserve-unknown-fields: true + path: + description: Path of the template + type: string type: object values: description: Shortcut to template.content.spec.values @@ -204,12 +203,11 @@ spec: properties: content: description: Content of the template - properties: - path: - description: Path of the template - type: string type: object x-kubernetes-preserve-unknown-fields: true + path: + description: Path of the template + type: string type: object values: description: Shortcut to template.content.spec.values diff --git a/config/crd/bases/templates.weave.works_gitopstemplates.yaml b/config/crd/bases/templates.weave.works_gitopstemplates.yaml index a7394d2..19f3e6d 100644 --- a/config/crd/bases/templates.weave.works_gitopstemplates.yaml +++ b/config/crd/bases/templates.weave.works_gitopstemplates.yaml @@ -74,12 +74,11 @@ spec: properties: content: description: Content of the template - properties: - path: - description: Path of the template - type: string type: object x-kubernetes-preserve-unknown-fields: true + path: + description: Path of the template + type: string type: object values: description: Shortcut to template.content.spec.values @@ -206,12 +205,11 @@ spec: properties: content: description: Content of the template - properties: - path: - description: Path of the template - type: string type: object x-kubernetes-preserve-unknown-fields: true + path: + description: Path of the template + type: string type: object values: description: Shortcut to template.content.spec.values From 3d6611b912630457ebf421650a320d2759a81e5f Mon Sep 17 00:00:00 2001 From: Rana Tarek Hassan Date: Wed, 18 Jan 2023 19:12:32 +0200 Subject: [PATCH 5/8] Format descriptions and regenerate crds --- apis/core/templates.go | 4 ++-- .../bases/capi.weave.works_capitemplates.yaml | 18 ++++++++++++------ .../templates.weave.works_gitopstemplates.yaml | 18 ++++++++++++------ 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/apis/core/templates.go b/apis/core/templates.go index 0b0f464..af353d3 100644 --- a/apis/core/templates.go +++ b/apis/core/templates.go @@ -74,7 +74,7 @@ type TemplateParam struct { type ChartsSpec struct { Items []Chart `json:"items,omitempty"` - // Template for the HelmRepository + // Template for the HelmRepository. // Shortcut to template.content.spec.chart.spec.helmRepositoryTemplate HelmRepositoryTemplate HelmRepositoryTemplateSpec `json:"helmRepositoryTemplate,omitempty"` } @@ -99,7 +99,7 @@ type Chart struct { Editable bool `json:"editable,omitempty"` // Shortcut to template.content.spec.values Values *HelmReleaseValues `json:"values,omitempty"` - // Template for the HelmRelease, merged with the default template + // Template for the HelmRelease, merged with the default template. // Shortcut to template.content.spec.chart.spec.template HelmReleaseTemplate HelmReleaseTemplateSpec `json:"template,omitempty"` } diff --git a/config/crd/bases/capi.weave.works_capitemplates.yaml b/config/crd/bases/capi.weave.works_capitemplates.yaml index a4abbbb..22c1d85 100644 --- a/config/crd/bases/capi.weave.works_capitemplates.yaml +++ b/config/crd/bases/capi.weave.works_capitemplates.yaml @@ -40,7 +40,8 @@ spec: description: Charts is the set of charts that are used in this template. properties: helmRepositoryTemplate: - description: Template for the HelmRepository Shortcut to template.content.spec.chart.spec.helmRepositoryTemplate + description: Template for the HelmRepository. + Shortcut to template.content.spec.chart.spec.helmRepositoryTemplate properties: path: type: string @@ -70,7 +71,8 @@ spec: type: string template: description: Template for the HelmRelease, merged with the - default template Shortcut to template.content.spec.chart.spec.template + default template. + Shortcut to template.content.spec.chart.spec.template properties: content: description: Content of the template @@ -85,7 +87,8 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true version: - description: Default version to select. Shortcut to template.content.spec.chart.spec.version + description: Default version to select. + Shortcut to template.content.spec.chart.spec.version type: string required: - chart @@ -169,7 +172,8 @@ spec: description: Charts is the set of charts that are used in this template. properties: helmRepositoryTemplate: - description: Template for the HelmRepository Shortcut to template.content.spec.chart.spec.helmRepositoryTemplate + description: Template for the HelmRepository. + Shortcut to template.content.spec.chart.spec.helmRepositoryTemplate properties: path: type: string @@ -199,7 +203,8 @@ spec: type: string template: description: Template for the HelmRelease, merged with the - default template Shortcut to template.content.spec.chart.spec.template + default template. + Shortcut to template.content.spec.chart.spec.template properties: content: description: Content of the template @@ -214,7 +219,8 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true version: - description: Default version to select. Shortcut to template.content.spec.chart.spec.version + description: Default version to select. + Shortcut to template.content.spec.chart.spec.version type: string required: - chart diff --git a/config/crd/bases/templates.weave.works_gitopstemplates.yaml b/config/crd/bases/templates.weave.works_gitopstemplates.yaml index 19f3e6d..705a420 100644 --- a/config/crd/bases/templates.weave.works_gitopstemplates.yaml +++ b/config/crd/bases/templates.weave.works_gitopstemplates.yaml @@ -40,7 +40,8 @@ spec: description: Charts is the set of charts that are used in this template. properties: helmRepositoryTemplate: - description: Template for the HelmRepository Shortcut to template.content.spec.chart.spec.helmRepositoryTemplate + description: Template for the HelmRepository. + Shortcut to template.content.spec.chart.spec.helmRepositoryTemplate properties: path: type: string @@ -70,7 +71,8 @@ spec: type: string template: description: Template for the HelmRelease, merged with the - default template Shortcut to template.content.spec.chart.spec.template + default template. + Shortcut to template.content.spec.chart.spec.template properties: content: description: Content of the template @@ -85,7 +87,8 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true version: - description: Default version to select. Shortcut to template.content.spec.chart.spec.version + description: Default version to select. + Shortcut to template.content.spec.chart.spec.version type: string required: - chart @@ -171,7 +174,8 @@ spec: description: Charts is the set of charts that are used in this template. properties: helmRepositoryTemplate: - description: Template for the HelmRepository Shortcut to template.content.spec.chart.spec.helmRepositoryTemplate + description: Template for the HelmRepository. + Shortcut to template.content.spec.chart.spec.helmRepositoryTemplate properties: path: type: string @@ -201,7 +205,8 @@ spec: type: string template: description: Template for the HelmRelease, merged with the - default template Shortcut to template.content.spec.chart.spec.template + default template. + Shortcut to template.content.spec.chart.spec.template properties: content: description: Content of the template @@ -216,7 +221,8 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true version: - description: Default version to select. Shortcut to template.content.spec.chart.spec.version + description: Default version to select. + Shortcut to template.content.spec.chart.spec.version type: string required: - chart From 932a199fe60db8ad410dd22a58a1a9731d0ae702 Mon Sep 17 00:00:00 2001 From: Rana Tarek Hassan <17128393+ranatrk@users.noreply.github.com> Date: Thu, 19 Jan 2023 12:04:43 +0200 Subject: [PATCH 6/8] Update apis/core/templates.go Co-authored-by: Simon --- apis/core/templates.go | 1 - 1 file changed, 1 deletion(-) diff --git a/apis/core/templates.go b/apis/core/templates.go index af353d3..fe5ba8a 100644 --- a/apis/core/templates.go +++ b/apis/core/templates.go @@ -100,7 +100,6 @@ type Chart struct { // Shortcut to template.content.spec.values Values *HelmReleaseValues `json:"values,omitempty"` // Template for the HelmRelease, merged with the default template. - // Shortcut to template.content.spec.chart.spec.template HelmReleaseTemplate HelmReleaseTemplateSpec `json:"template,omitempty"` } From 9764506267bb306a3ec1286c64ea428a47d8ae4b Mon Sep 17 00:00:00 2001 From: Rana Tarek Hassan Date: Thu, 19 Jan 2023 13:25:00 +0200 Subject: [PATCH 7/8] Update helmrepositorytemplate and helmreleasetemplate path description strings --- apis/core/templates.go | 6 +++--- .../bases/capi.weave.works_capitemplates.yaml | 18 ++++++------------ .../templates.weave.works_gitopstemplates.yaml | 18 ++++++------------ 3 files changed, 15 insertions(+), 27 deletions(-) diff --git a/apis/core/templates.go b/apis/core/templates.go index af353d3..99c59db 100644 --- a/apis/core/templates.go +++ b/apis/core/templates.go @@ -104,14 +104,14 @@ type Chart struct { HelmReleaseTemplate HelmReleaseTemplateSpec `json:"template,omitempty"` } -// HelmRepositoryTemplateSpec is a future proof way to define a template with a path +// HelmRepositoryTemplateSpec is a way to define a repository template path // +kubebuilder:object:generate=true type HelmRepositoryTemplateSpec struct { Path string `json:"path,omitempty"` } -// HelmReleaseTemplateSpec is a future proof way to define a template with a path -// path is not yet used, but will be used in the near future +// HelmReleaseTemplateSpec is a way to define a template with a path +// content is not yet used, but will be used in the near future // +kubebuilder:object:generate=true type HelmReleaseTemplateSpec struct { // Path of the template diff --git a/config/crd/bases/capi.weave.works_capitemplates.yaml b/config/crd/bases/capi.weave.works_capitemplates.yaml index 22c1d85..c37e3cf 100644 --- a/config/crd/bases/capi.weave.works_capitemplates.yaml +++ b/config/crd/bases/capi.weave.works_capitemplates.yaml @@ -40,8 +40,7 @@ spec: description: Charts is the set of charts that are used in this template. properties: helmRepositoryTemplate: - description: Template for the HelmRepository. - Shortcut to template.content.spec.chart.spec.helmRepositoryTemplate + description: Template for the HelmRepository. Shortcut to template.content.spec.chart.spec.helmRepositoryTemplate properties: path: type: string @@ -71,8 +70,7 @@ spec: type: string template: description: Template for the HelmRelease, merged with the - default template. - Shortcut to template.content.spec.chart.spec.template + default template. Shortcut to template.content.spec.chart.spec.template properties: content: description: Content of the template @@ -87,8 +85,7 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true version: - description: Default version to select. - Shortcut to template.content.spec.chart.spec.version + description: Default version to select. Shortcut to template.content.spec.chart.spec.version type: string required: - chart @@ -172,8 +169,7 @@ spec: description: Charts is the set of charts that are used in this template. properties: helmRepositoryTemplate: - description: Template for the HelmRepository. - Shortcut to template.content.spec.chart.spec.helmRepositoryTemplate + description: Template for the HelmRepository. Shortcut to template.content.spec.chart.spec.helmRepositoryTemplate properties: path: type: string @@ -203,8 +199,7 @@ spec: type: string template: description: Template for the HelmRelease, merged with the - default template. - Shortcut to template.content.spec.chart.spec.template + default template. Shortcut to template.content.spec.chart.spec.template properties: content: description: Content of the template @@ -219,8 +214,7 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true version: - description: Default version to select. - Shortcut to template.content.spec.chart.spec.version + description: Default version to select. Shortcut to template.content.spec.chart.spec.version type: string required: - chart diff --git a/config/crd/bases/templates.weave.works_gitopstemplates.yaml b/config/crd/bases/templates.weave.works_gitopstemplates.yaml index 705a420..d45a214 100644 --- a/config/crd/bases/templates.weave.works_gitopstemplates.yaml +++ b/config/crd/bases/templates.weave.works_gitopstemplates.yaml @@ -40,8 +40,7 @@ spec: description: Charts is the set of charts that are used in this template. properties: helmRepositoryTemplate: - description: Template for the HelmRepository. - Shortcut to template.content.spec.chart.spec.helmRepositoryTemplate + description: Template for the HelmRepository. Shortcut to template.content.spec.chart.spec.helmRepositoryTemplate properties: path: type: string @@ -71,8 +70,7 @@ spec: type: string template: description: Template for the HelmRelease, merged with the - default template. - Shortcut to template.content.spec.chart.spec.template + default template. Shortcut to template.content.spec.chart.spec.template properties: content: description: Content of the template @@ -87,8 +85,7 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true version: - description: Default version to select. - Shortcut to template.content.spec.chart.spec.version + description: Default version to select. Shortcut to template.content.spec.chart.spec.version type: string required: - chart @@ -174,8 +171,7 @@ spec: description: Charts is the set of charts that are used in this template. properties: helmRepositoryTemplate: - description: Template for the HelmRepository. - Shortcut to template.content.spec.chart.spec.helmRepositoryTemplate + description: Template for the HelmRepository. Shortcut to template.content.spec.chart.spec.helmRepositoryTemplate properties: path: type: string @@ -205,8 +201,7 @@ spec: type: string template: description: Template for the HelmRelease, merged with the - default template. - Shortcut to template.content.spec.chart.spec.template + default template. Shortcut to template.content.spec.chart.spec.template properties: content: description: Content of the template @@ -221,8 +216,7 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true version: - description: Default version to select. - Shortcut to template.content.spec.chart.spec.version + description: Default version to select. Shortcut to template.content.spec.chart.spec.version type: string required: - chart From 7fca399f857c2832471d9c76740c6e4a029f73bf Mon Sep 17 00:00:00 2001 From: Rana Tarek Hassan Date: Thu, 19 Jan 2023 13:34:57 +0200 Subject: [PATCH 8/8] Update crd generated --- config/crd/bases/capi.weave.works_capitemplates.yaml | 4 ++-- config/crd/bases/templates.weave.works_gitopstemplates.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/crd/bases/capi.weave.works_capitemplates.yaml b/config/crd/bases/capi.weave.works_capitemplates.yaml index c37e3cf..9537ccb 100644 --- a/config/crd/bases/capi.weave.works_capitemplates.yaml +++ b/config/crd/bases/capi.weave.works_capitemplates.yaml @@ -70,7 +70,7 @@ spec: type: string template: description: Template for the HelmRelease, merged with the - default template. Shortcut to template.content.spec.chart.spec.template + default template. properties: content: description: Content of the template @@ -199,7 +199,7 @@ spec: type: string template: description: Template for the HelmRelease, merged with the - default template. Shortcut to template.content.spec.chart.spec.template + default template. properties: content: description: Content of the template diff --git a/config/crd/bases/templates.weave.works_gitopstemplates.yaml b/config/crd/bases/templates.weave.works_gitopstemplates.yaml index d45a214..50bdb42 100644 --- a/config/crd/bases/templates.weave.works_gitopstemplates.yaml +++ b/config/crd/bases/templates.weave.works_gitopstemplates.yaml @@ -70,7 +70,7 @@ spec: type: string template: description: Template for the HelmRelease, merged with the - default template. Shortcut to template.content.spec.chart.spec.template + default template. properties: content: description: Content of the template @@ -201,7 +201,7 @@ spec: type: string template: description: Template for the HelmRelease, merged with the - default template. Shortcut to template.content.spec.chart.spec.template + default template. properties: content: description: Content of the template