Skip to content

Commit aeb3f5c

Browse files
authored
feat: optional custom resource definition as resource in component (#63)
1 parent 739f11e commit aeb3f5c

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

components.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ resources:
7575
- <<<: (( sum[funcs.splitIgnoreEmpty(",", funcs.ignoreDisabled(defaults.BP_COMPONENTS))|[]|s,comp|-> s *templates.blueprint] ))
7676
- <<<: (( 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] ))
7777
- <<<: (( 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] ))
78+
- <<<: (( sum[funcs.splitIgnoreEmpty(",", funcs.ignoreDisabled(defaults.CRDS_COMPONENTS))|[]|s,cv|-> ("cvs" = split(":", cv)) ("comp" = cvs[0], "crds_version" = (cvs[1] || defaults.CRDS_VERSION)) s *templates.crds] ))
7879

7980

8081
# ##########################################################################
@@ -88,6 +89,8 @@ defaults:
8889
BP_COMPONENTS: (( funcs.notEmpty(values.BP_PATH || "") ? ( funcs.notEmpty(values.BP_COMPONENTS || "") ? values.BP_COMPONENTS :values.COMPONENTS ) :"" ))
8990
CHART_COMPONENTS: (( funcs.notEmpty(values.CHART_COMPONENTS || "") ? values.CHART_COMPONENTS :values.COMPONENTS ))
9091
IMG_COMPONENTS: (( funcs.notEmpty(values.IMG_COMPONENTS || "") ? values.IMG_COMPONENTS :values.COMPONENTS ))
92+
CRDS_COMPONENTS: (( funcs.notEmpty(values.CRDS_COMPONENTS || "") ? values.CRDS_COMPONENTS :values.COMPONENTS ))
93+
CRDS_VERSION: (( funcs.notEmpty(values.CRDS_VERSION || "") ? values.CRDS_VERSION :values.VERSION ))
9194

9295
funcs:
9396
<<<: (( &temporary ))
@@ -120,6 +123,14 @@ templates:
120123
access:
121124
imageReference: (( values.IMG_REGISTRY "/" comp ":" img_version ))
122125
type: ociArtifact
126+
crds:
127+
<<<: (( &template ))
128+
name: (( comp "-crds" ))
129+
type: fileSystem
130+
version: (( crds_version ))
131+
input:
132+
type: dir
133+
path: (( values.CRDS_PATH ))
123134

124135

125136

tasks_build_ocm.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ tasks:
5555
IMG_VERSION="{{.IMG_VERSION | default ""}}" \
5656
BP_COMPONENTS="{{.BP_COMPONENTS | default ""}}" \
5757
CHART_COMPONENTS="{{.CHART_COMPONENTS | default ""}}" \
58-
IMG_COMPONENTS="{{.IMG_COMPONENTS | default ""}}"
58+
IMG_COMPONENTS="{{.IMG_COMPONENTS | default ""}}" \
59+
CRDS_COMPONENTS="{{.CRDS_COMPONENTS | default "[]"}}" \
60+
CRDS_VERSION="{{.CRDS_VERSION | default ""}}" \
61+
CRDS_PATH="{{.CRDS_PATH | default ""}}"
5962
- cmd: echo "Use '$(realpath --relative-base="{{.USER_WORKING_DIR}}" "{{.OCM}}") get cv $(realpath --relative-base="{{.USER_WORKING_DIR}}" "{{.compdir}}") -o yaml' to view the generated component descriptor."
6063
silent: true
6164

0 commit comments

Comments
 (0)