Skip to content

Commit 4d021bc

Browse files
authored
Merge pull request #8 from weaveworks/2107-profile-path-support
Add path support for profiles in templates
2 parents a21effc + 7fca399 commit 4d021bc

File tree

4 files changed

+70
-11
lines changed

4 files changed

+70
-11
lines changed

apis/core/templates.go

+14-3
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ type TemplateParam struct {
7474

7575
type ChartsSpec struct {
7676
Items []Chart `json:"items,omitempty"`
77+
// Template for the HelmRepository.
78+
// Shortcut to template.content.spec.chart.spec.helmRepositoryTemplate
79+
HelmRepositoryTemplate HelmRepositoryTemplateSpec `json:"helmRepositoryTemplate,omitempty"`
7780
}
7881

7982
// Chart is the set of values that control the default and required values
@@ -96,14 +99,22 @@ type Chart struct {
9699
Editable bool `json:"editable,omitempty"`
97100
// Shortcut to template.content.spec.values
98101
Values *HelmReleaseValues `json:"values,omitempty"`
99-
// Template for the HelmRelease, merged with the default template
102+
// Template for the HelmRelease, merged with the default template.
100103
HelmReleaseTemplate HelmReleaseTemplateSpec `json:"template,omitempty"`
101104
}
102105

103-
// HelmReleaseTemplateSpec is a future proof way to define a template with a path
104-
// path is not yet used, but will be used in the near future
106+
// HelmRepositoryTemplateSpec is a way to define a repository template path
107+
// +kubebuilder:object:generate=true
108+
type HelmRepositoryTemplateSpec struct {
109+
Path string `json:"path,omitempty"`
110+
}
111+
112+
// HelmReleaseTemplateSpec is a way to define a template with a path
113+
// content is not yet used, but will be used in the near future
105114
// +kubebuilder:object:generate=true
106115
type HelmReleaseTemplateSpec struct {
116+
// Path of the template
117+
Path string `json:"path,omitempty"`
107118
// Content of the template
108119
Content *HelmReleaseTemplate `json:"content,omitempty"`
109120
}

apis/core/zz_generated.deepcopy.go

+16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/capi.weave.works_capitemplates.yaml

+20-4
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ spec:
3939
charts:
4040
description: Charts is the set of charts that are used in this template.
4141
properties:
42+
helmRepositoryTemplate:
43+
description: Template for the HelmRepository. Shortcut to template.content.spec.chart.spec.helmRepositoryTemplate
44+
properties:
45+
path:
46+
type: string
47+
type: object
4248
items:
4349
items:
4450
description: Chart is the set of values that control the default
@@ -64,12 +70,15 @@ spec:
6470
type: string
6571
template:
6672
description: Template for the HelmRelease, merged with the
67-
default template
73+
default template.
6874
properties:
6975
content:
7076
description: Content of the template
7177
type: object
7278
x-kubernetes-preserve-unknown-fields: true
79+
path:
80+
description: Path of the template
81+
type: string
7382
type: object
7483
values:
7584
description: Shortcut to template.content.spec.values
@@ -159,6 +168,12 @@ spec:
159168
charts:
160169
description: Charts is the set of charts that are used in this template.
161170
properties:
171+
helmRepositoryTemplate:
172+
description: Template for the HelmRepository. Shortcut to template.content.spec.chart.spec.helmRepositoryTemplate
173+
properties:
174+
path:
175+
type: string
176+
type: object
162177
items:
163178
items:
164179
description: Chart is the set of values that control the default
@@ -184,12 +199,15 @@ spec:
184199
type: string
185200
template:
186201
description: Template for the HelmRelease, merged with the
187-
default template
202+
default template.
188203
properties:
189204
content:
190205
description: Content of the template
191206
type: object
192207
x-kubernetes-preserve-unknown-fields: true
208+
path:
209+
description: Path of the template
210+
type: string
193211
type: object
194212
values:
195213
description: Shortcut to template.content.spec.values
@@ -259,8 +277,6 @@ spec:
259277
type: array
260278
path:
261279
type: string
262-
required:
263-
- content
264280
type: object
265281
type: array
266282
type: object

config/crd/bases/templates.weave.works_gitopstemplates.yaml

+20-4
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ spec:
3939
charts:
4040
description: Charts is the set of charts that are used in this template.
4141
properties:
42+
helmRepositoryTemplate:
43+
description: Template for the HelmRepository. Shortcut to template.content.spec.chart.spec.helmRepositoryTemplate
44+
properties:
45+
path:
46+
type: string
47+
type: object
4248
items:
4349
items:
4450
description: Chart is the set of values that control the default
@@ -64,12 +70,15 @@ spec:
6470
type: string
6571
template:
6672
description: Template for the HelmRelease, merged with the
67-
default template
73+
default template.
6874
properties:
6975
content:
7076
description: Content of the template
7177
type: object
7278
x-kubernetes-preserve-unknown-fields: true
79+
path:
80+
description: Path of the template
81+
type: string
7382
type: object
7483
values:
7584
description: Shortcut to template.content.spec.values
@@ -161,6 +170,12 @@ spec:
161170
charts:
162171
description: Charts is the set of charts that are used in this template.
163172
properties:
173+
helmRepositoryTemplate:
174+
description: Template for the HelmRepository. Shortcut to template.content.spec.chart.spec.helmRepositoryTemplate
175+
properties:
176+
path:
177+
type: string
178+
type: object
164179
items:
165180
items:
166181
description: Chart is the set of values that control the default
@@ -186,12 +201,15 @@ spec:
186201
type: string
187202
template:
188203
description: Template for the HelmRelease, merged with the
189-
default template
204+
default template.
190205
properties:
191206
content:
192207
description: Content of the template
193208
type: object
194209
x-kubernetes-preserve-unknown-fields: true
210+
path:
211+
description: Path of the template
212+
type: string
195213
type: object
196214
values:
197215
description: Shortcut to template.content.spec.values
@@ -261,8 +279,6 @@ spec:
261279
type: array
262280
path:
263281
type: string
264-
required:
265-
- content
266282
type: object
267283
type: array
268284
type: object

0 commit comments

Comments
 (0)