Skip to content

Commit 5081247

Browse files
author
Georg Martin Weber
committed
revert installation yaml move to dockerfile
1 parent 7873d30 commit 5081247

File tree

6 files changed

+91
-69
lines changed

6 files changed

+91
-69
lines changed

hull-vidispine-addon/files/test/HULL/specs/job.spec

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,21 @@ Test creation of objects and features.
1919
## Installation Job
2020
* Render
2121
* Set test object to "release-name-hull-test-hull-install"
22-
* Test Object has key "spec§template§spec§containers§0§volumeMounts" with array value that has "2" items
22+
* Test Object has key "spec§template§spec§containers§0§volumeMounts" with array value that has "3" items
2323
* Test Object has key "spec§template§spec§containers§0§volumeMounts§0§name" with value "custom-installation-files"
24+
* Test Object has key "spec§template§spec§containers§0§volumeMounts§1§name" with value "installation"
2425

25-
* Test Object has key "spec§template§spec§volumes" with array value that has "2" items
26+
* Test Object has key "spec§template§spec§volumes" with array value that has "3" items
2627
* Test Object has key "spec§template§spec§volumes§0§name" with value "custom-installation-files"
28+
* Test Object has key "spec§template§spec§volumes§1§name" with value "installation"
2729

2830
## Certificates
2931
* Prepare default test case for this kind including suites "pod,customcacertificates"
3032
* Render
3133

3234
* Set test object to "release-name-hull-test-hull-install"
3335

34-
* Test Object has key "spec§template§spec§containers§0§volumeMounts" with array value that has "5" items
36+
* Test Object has key "spec§template§spec§containers§0§volumeMounts" with array value that has "6" items
3537
* Test Object has key "spec§template§spec§containers§0§volumeMounts§0§name" with value "certs"
3638
* Test Object has key "spec§template§spec§containers§0§volumeMounts§0§mountPath" with value "/usr/local/share/ca-certificates/custom-ca-certificates-test_cert_1"
3739
* Test Object has key "spec§template§spec§containers§0§volumeMounts§1§name" with value "certs"
@@ -40,12 +42,16 @@ Test creation of objects and features.
4042
* Test Object has key "spec§template§spec§containers§0§volumeMounts§2§mountPath" with value "/custom-installation-files"
4143
* Test Object has key "spec§template§spec§containers§0§volumeMounts§3§name" with value "etcssl"
4244
* Test Object has key "spec§template§spec§containers§0§volumeMounts§3§mountPath" with value "/etc/ssl/certs"
45+
* Test Object has key "spec§template§spec§containers§0§volumeMounts§4§name" with value "installation"
46+
* Test Object has key "spec§template§spec§containers§0§volumeMounts§4§mountPath" with value "/script/installation.yaml"
47+
* Test Object has key "spec§template§spec§containers§0§volumeMounts§4§subPath" with value "installation.yaml"
4348

44-
* Test Object has key "spec§template§spec§volumes" with array value that has "4" items
49+
* Test Object has key "spec§template§spec§volumes" with array value that has "5" items
4550
* Test Object has key "spec§template§spec§volumes§0§name" with value "certs"
4651
* Test Object has key "spec§template§spec§volumes§1§name" with value "custom-installation-files"
4752
* Test Object has key "spec§template§spec§volumes§2§name" with value "etcssl"
48-
* Test Object has key "spec§template§spec§volumes§3§name" with value "oci-license"
53+
* Test Object has key "spec§template§spec§volumes§3§name" with value "installation"
54+
* Test Object has key "spec§template§spec§volumes§4§name" with value "oci-license"
4955

5056
* Set test object to "release-name-hull-test-custom-ca-certificates" of kind "Secret"
5157
* Test Object has key "data§test_cert_1" with Base64 encoded value of "CERT-DATA-1"
@@ -56,7 +62,7 @@ Test creation of objects and features.
5662

5763
* Set test object to "release-name-hull-test-hull-install"
5864

59-
* Test Object has key "spec§template§spec§containers§0§volumeMounts" with array value that has "6" items
65+
* Test Object has key "spec§template§spec§containers§0§volumeMounts" with array value that has "7" items
6066
* Test Object has key "spec§template§spec§containers§0§volumeMounts§0§name" with value "certs-opensearch"
6167
* Test Object has key "spec§template§spec§containers§0§volumeMounts§0§mountPath" with value "/usr/local/share/ca-certificates/custom-ca-certificates-opensearch-cert.tls"
6268
* Test Object has key "spec§template§spec§containers§0§volumeMounts§1§name" with value "certs-opensearch"
@@ -67,23 +73,27 @@ Test creation of objects and features.
6773
* Test Object has key "spec§template§spec§containers§0§volumeMounts§3§mountPath" with value "/custom-installation-files"
6874
* Test Object has key "spec§template§spec§containers§0§volumeMounts§4§name" with value "etcssl"
6975
* Test Object has key "spec§template§spec§containers§0§volumeMounts§4§mountPath" with value "/etc/ssl/certs"
76+
* Test Object has key "spec§template§spec§containers§0§volumeMounts§5§name" with value "installation"
77+
* Test Object has key "spec§template§spec§containers§0§volumeMounts§5§mountPath" with value "/script/installation.yaml"
78+
* Test Object has key "spec§template§spec§containers§0§volumeMounts§5§subPath" with value "installation.yaml"
7079

71-
* Test Object has key "spec§template§spec§volumes" with array value that has "5" items
80+
* Test Object has key "spec§template§spec§volumes" with array value that has "6" items
7281
* Test Object has key "spec§template§spec§volumes§0§name" with value "certs-opensearch"
7382
* Test Object has key "spec§template§spec§volumes§0§secret§secretName" with value "opensearch-node-certs"
7483
* Test Object has key "spec§template§spec§volumes§1§name" with value "certs-storage"
7584
* Test Object has key "spec§template§spec§volumes§1§secret§secretName" with value "storage-server-secret"
7685
* Test Object has key "spec§template§spec§volumes§2§name" with value "custom-installation-files"
7786
* Test Object has key "spec§template§spec§volumes§3§name" with value "etcssl"
78-
* Test Object has key "spec§template§spec§volumes§4§name" with value "oci-license"
87+
* Test Object has key "spec§template§spec§volumes§4§name" with value "installation"
88+
* Test Object has key "spec§template§spec§volumes§5§name" with value "oci-license"
7989

8090

8191
* Prepare default test case for this kind including suites "pod,certificatesecrets,customcacertificates"
8292
* Render
8393

8494
* Set test object to "release-name-hull-test-hull-install"
8595

86-
* Test Object has key "spec§template§spec§containers§0§volumeMounts" with array value that has "8" items
96+
* Test Object has key "spec§template§spec§containers§0§volumeMounts" with array value that has "9" items
8797
* Test Object has key "spec§template§spec§containers§0§volumeMounts§0§name" with value "certs-opensearch"
8898
* Test Object has key "spec§template§spec§containers§0§volumeMounts§0§mountPath" with value "/usr/local/share/ca-certificates/custom-ca-certificates-opensearch-cert.tls"
8999
* Test Object has key "spec§template§spec§containers§0§volumeMounts§1§name" with value "certs-opensearch"
@@ -98,18 +108,21 @@ Test creation of objects and features.
98108
* Test Object has key "spec§template§spec§containers§0§volumeMounts§5§mountPath" with value "/custom-installation-files"
99109
* Test Object has key "spec§template§spec§containers§0§volumeMounts§6§name" with value "etcssl"
100110
* Test Object has key "spec§template§spec§containers§0§volumeMounts§6§mountPath" with value "/etc/ssl/certs"
111+
* Test Object has key "spec§template§spec§containers§0§volumeMounts§7§name" with value "installation"
112+
* Test Object has key "spec§template§spec§containers§0§volumeMounts§7§mountPath" with value "/script/installation.yaml"
113+
* Test Object has key "spec§template§spec§containers§0§volumeMounts§7§subPath" with value "installation.yaml"
101114

102-
* Test Object has key "spec§template§spec§volumes" with array value that has "6" items
115+
* Test Object has key "spec§template§spec§volumes" with array value that has "7" items
103116
* Test Object has key "spec§template§spec§volumes§0§name" with value "certs"
104117
* Test Object has key "spec§template§spec§volumes§1§name" with value "certs-opensearch"
105118
* Test Object has key "spec§template§spec§volumes§1§secret§secretName" with value "opensearch-node-certs"
106119
* Test Object has key "spec§template§spec§volumes§2§name" with value "certs-storage"
107120
* Test Object has key "spec§template§spec§volumes§2§secret§secretName" with value "storage-server-secret"
108121
* Test Object has key "spec§template§spec§volumes§3§name" with value "custom-installation-files"
109122
* Test Object has key "spec§template§spec§volumes§4§name" with value "etcssl"
110-
* Test Object has key "spec§template§spec§volumes§5§name" with value "oci-license"
123+
* Test Object has key "spec§template§spec§volumes§5§name" with value "installation"
124+
* Test Object has key "spec§template§spec§volumes§6§name" with value "oci-license"
111125

112126
___
113127

114-
115128
* Clean the test execution folder

hull-vidispine-addon/files/test/HULL/specs/secret.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Test creation of objects and features.
66

77
## Render and Validate
88
* Render
9-
* Expected number of "12" objects were rendered
9+
* Expected number of "13" objects were rendered
1010
* Validate
1111

1212
## Metadata
@@ -38,6 +38,10 @@ Test creation of objects and features.
3838
* Set test object to "release-name-hull-test-transformation_resolved"
3939
* Test Object has key "data§concrete_file_4_resolved.txt" with Base64 encoded value of "This is a text file with a pointer to a transformation."
4040

41+
## Default Secret
42+
* Render
43+
* Set test object to "release-name-hull-test-hull-install"
44+
* Test Object has key "data§installation.yaml" with non empty value
4145
___
4246

4347
* Clean the test execution folder

hull-vidispine-addon/hull-vidispine-addon.yaml

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,12 +640,66 @@ hull:
640640
helm.sh/hook-weight: "-15"
641641
helm.sh/hook-delete-policy: before-hook-creation
642642
'hull-install':
643-
enabled: _HT*hull.config.general.data.installation.config.debug.debugInstallerScript
644643
sources:
645644
- custom-installation-files-setup
646645
- _HULL_OBJECT_TYPE_DEFAULT_
647646
data:
647+
installation.yaml:
648+
inline: |-
649+
{{- with (index $.Values "hull").config.general.data.installation }}
650+
{{- $configScope := . -}}
651+
{{- $configScopeEndpoints := dict -}}
652+
{{- if hasKey . "endpoints" -}}
653+
{{- $configScopeEndpoints = .endpoints -}}
654+
{{- end -}}
655+
{{- range $path, $_ := $.Files.Glob "files/hull-vidispine-addon/installation/endpoints/*.yaml" -}}
656+
{{- $configScopeEndpoints = mergeOverwrite $configScopeEndpoints (dict (base $path | trimSuffix ".yaml") (fromYaml ($.Files.Get $path))) -}}
657+
{{- end -}}
658+
{{- range $endpoint, $endpointval := $configScopeEndpoints -}}
659+
{{- $endpointScope := $endpointval -}}
660+
{{- if $endpointval.endpoint -}}
661+
{{- $subresources := dict -}}
662+
{{- if hasKey $endpointval "subresources" -}}
663+
{{- $subresources = $endpointval.subresources -}}
664+
{{- end -}}
665+
{{- range $path, $_ := $.Files.Glob (printf "%s/%s/%s" "files/hull-vidispine-addon/installation/endpoints" $endpoint "*.yaml") -}}
666+
{{- $subresources = mergeOverwrite $subresources (dict (base $path | trimSuffix ".yaml") (fromYaml ($.Files.Get $path))) -}}
667+
{{- end -}}
668+
{{- range $subresource, $subresourceval := $subresources }}
669+
{{- $subresourceScope := $subresourceval -}}
670+
{{- $entities := dict -}}
671+
{{- if hasKey $subresourceval "entities" -}}
672+
{{- $entities = $subresourceval.entities -}}
673+
{{- else -}}
674+
{{- $u := set $subresourceval "entities" dict }}
675+
{{- end -}}
676+
{{- range $path, $_ := $.Files.Glob (printf "%s/%s/%s/%s" "files/hull-vidispine-addon/installation/endpoints" $endpoint $subresource "*.yaml") -}}
677+
{{- $entities = mergeOverwrite $entities (dict (base $path | trimSuffix ".yaml") (fromYaml ($.Files.Get $path))) -}}
678+
{{- end -}}
679+
{{- range $entity, $entityval := $entities }}
680+
{{- $mergedDict := dict -}}
681+
{{- if hasKey $subresourceval "_DEFAULTS_" -}}
682+
{{- $mergedDict = deepCopy $subresourceval._DEFAULTS_ -}}
683+
{{- end -}}
684+
{{- $t := mergeOverwrite $mergedDict $entityval -}}
685+
{{- $z := set (index $.Values "hull").config.general.data.installation "endpoints" $configScopeEndpoints }}
686+
{{- if typeIs "map[string]interface {}" $mergedDict -}}
687+
{{- if hasKey $mergedDict "config" -}}
688+
{{- $configDict := $mergedDict.config -}}
689+
{{- end }}
690+
{{- end }}
691+
{{- $t1 := set $subresourceval.entities $entity $mergedDict -}}
692+
{{- end }}
693+
{{- end }}
694+
{{- else -}}
695+
{{- $configScopeEndpoints = unset $configScopeEndpoints $endpoint -}}
696+
{{- end }}
697+
{{- end }}
698+
{{- $_ := include "hull.util.transformation" (dict "PARENT_CONTEXT" $ "SOURCE" $configScope "CALLER" nil "CALLER_KEY" nil "SOURCE_PATH" list) -}}
699+
{{- toYaml $configScope -}}
700+
{{ end }}
648701
Installer.ps1:
702+
enabled: _HT*hull.config.general.data.installation.config.debug.debugInstallerScript
649703
inline: |-
650704
*** ENABLE hull.config.general.data.installation.config.debug.debugInstallerScript
651705
*** AND COPY SCRIPT CODE FROM

hull-vidispine-addon/templates/_transformations.tpl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,10 @@ Icon: |-
108108
{{ define "hull.vidispine.addon.sources.folder.volumes" }}
109109
{{ $parent := (index . "PARENT_CONTEXT") }}
110110
{
111-
{{ if $parent.Values.hull.config.general.data.installation.config.debug.debugInstallerScript }}
112111
"installation":
113112
{
114113
"secret":{ "secretName": "hull-install" }
115114
},
116-
{{ end }}
117115
"custom-installation-files":
118116
{
119117
"secret": { "secretName": "custom-installation-files" }
@@ -165,6 +163,12 @@ Icon: |-
165163
{{ define "hull.vidispine.addon.sources.folder.volumemounts" }}
166164
{{ $parent := (index . "PARENT_CONTEXT") }}
167165
{
166+
"installation":
167+
{
168+
"name": "installation",
169+
"mountPath": "/script/installation.yaml",
170+
"subPath": "installation.yaml"
171+
},
168172
{{ if $parent.Values.hull.config.general.data.installation.config.debug.debugInstallerScript }}
169173
"installer":
170174
{

images/hull-integration/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@ RUN tar -zxf oras_${VERSION}_*.tar.gz -C oras-install/
1010
RUN mv oras-install/oras /usr/local/bin/
1111
RUN rm -rf oras_${VERSION}_*.tar.gz oras-install/
1212
COPY ./Installer.ps1 /script/Installer.ps1
13-
COPY ./installation.yaml /script/installation.yaml
1413
COPY ./get-custom-scripts /get-custom-scripts
1514
RUN oras --help

images/hull-integration/installation.yaml

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)