Skip to content

Commit e58e9b7

Browse files
committed
add possibility to completely disable helm charts in OCM generation
1 parent 7a0d273 commit e58e9b7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

components.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,20 @@
4141
# - Comma-separated list of components for which the blueprint should be added to the component descriptor, e.g. "apiserver-controller,managedcontrolplane-controller,landscaper-connector"
4242
# - Each element will result in a resource entry of type 'landscaper.gardener.cloud/blueprint' named '<component>-blueprint'. The corresponding blueprint is expected at 'BP_PATH/<component>' (relative to this file).
4343
# - Defaults to COMPONENTS if BP_PATH is set and is empty otherwise.
44+
# - Set this to "[]" to not add any blueprints to the component descriptor.
4445
# - CHART_COMPONENTS
4546
# - Comma-separated list of components for which helm charts should be referenced in the component descriptor, optionally with version (separated by ":").
4647
# - Example: "apiserver-controller:v0.1.0,managedcontrolplane-controller:v0.2.0,landscaper-connector"
4748
# - Each element will result in a resource entry of type 'helmChart' named '<component>-chart'. The chart is expected in the OCI registry at '<CHART_REGISTRY>/<component>:<version>'.
4849
# - Defaults to COMPONENTS if not specified.
50+
# - Set this to "[]" to not add any helm charts to the component descriptor.
4951
# - Each chart's version defaults to CHART_VERSION if not specified.
5052
# - IMG_COMPONENTS
5153
# - Comma-separated list of components for which container images should be referenced in the component descriptor, optionally with version (separated by ":").
5254
# - Example: "apiserver-controller:v0.1.0,managedcontrolplane-controller:v0.2.0,landscaper-connector"
5355
# - Each element will result in a resource entry of type 'ociImage' named '<component>-image'. The image is expected in the OCI registry at '<IMG_REGISTRY>/<component>:<version>'.
5456
# - Defaults to COMPONENTS if not specified.
57+
# - Set this to "[]" to not add any images to the component descriptor.
5558
# - Each image's version defaults to IMG_VERSION if not specified.
5659

5760

@@ -70,9 +73,9 @@ sources:
7073
commit: (( values.COMMIT ))
7174
ref: (( contains(values.VERSION, "-dev") ? ~~ :"refs/tags/" values.VERSION ))
7275
resources:
73-
- <<<: (( sum[funcs.splitIgnoreEmpty(",", defaults.BP_COMPONENTS)|[]|s,comp|-> s *templates.blueprint] ))
74-
- <<<: (( sum[funcs.splitIgnoreEmpty(",", defaults.CHART_COMPONENTS)|[]|s,cv|-> ("cvs" = split(":", cv)) ("comp" = cvs[0], "chart_version" = (cvs[1] || defaults.CHART_VERSION)) s *templates.chart] ))
75-
- <<<: (( sum[funcs.splitIgnoreEmpty(",", defaults.IMG_COMPONENTS)|[]|s,cv|-> ("cvs" = split(":", cv)) ("comp" = cvs[0], "img_version" = (cvs[1] || defaults.IMG_VERSION)) s *templates.image] ))
76+
- <<<: (( sum[funcs.splitIgnoreEmpty(",", funcs.ignoreDisabled(defaults.BP_COMPONENTS))|[]|s,comp|-> s *templates.blueprint] ))
77+
- <<<: (( sum[funcs.splitIgnoreEmpty(",", funcs.ignoreDisabled(defaults.CHART_COMPONENTS))|[]|s,cv|-> ("cvs" = split(":", cv)) ("comp" = cvs[0], "chart_version" = (cvs[1] || defaults.CHART_VERSION)) s *templates.chart] ))
78+
- <<<: (( sum[funcs.splitIgnoreEmpty(",", funcs.ignoreDisabled(defaults.IMG_COMPONENTS))|[]|s,cv|-> ("cvs" = split(":", cv)) ("comp" = cvs[0], "img_version" = (cvs[1] || defaults.IMG_VERSION)) s *templates.image] ))
7679

7780

7881
# ##########################################################################
@@ -91,6 +94,7 @@ funcs:
9194
<<<: (( &temporary ))
9295
notEmpty: (( |x|-> x != "" )) # returns true if the input is not an empty string
9396
splitIgnoreEmpty: (( |d,s|-> select[split(d, s)|x|-> x != ""] )) # splits a string by a delimiter and removes empty elements
97+
ignoreDisabled: (( |x|-> x == "[]" ? "" :x )) # returns an empty string if the input is an empty array, otherwise returns the input as is
9498

9599
templates:
96100
<<<: (( &temporary ))

0 commit comments

Comments
 (0)