Skip to content

Commit 7e2883d

Browse files
committed
avoid writing empty custom-installation-files secret
1 parent bf83eed commit 7e2883d

6 files changed

Lines changed: 44 additions & 50 deletions

File tree

hull-vidispine-addon/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Basic chart description and version
22
apiVersion: v1
3-
appVersion: 1.33.1
3+
appVersion: "1.34"
44
description: hull-vidispine-addon
55
name: hull-vidispine-addon
6-
version: 1.34.0
6+
version: 1.34.1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
GAUGE_PYTHON_COMMAND = python
1+
GAUGE_PYTHON_COMMAND = python3
22

33
# Comma seperated list of dirs. path should be relative to project root.
44
STEP_IMPL_DIR = step_impl

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

Lines changed: 35 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -19,39 +19,34 @@ 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 "3" items
23-
* 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"
22+
* Test Object has key "spec§template§spec§containers§0§volumeMounts" with array value that has "2" items
23+
* Test Object has key "spec§template§spec§containers§0§volumeMounts§0§name" with value "installation"
2524

26-
* Test Object has key "spec§template§spec§volumes" with array value that has "3" items
27-
* 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"
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§0§name" with value "installation"
2927

3028
## Certificates
3129
* Prepare default test case for this kind including suites "pod,customcacertificates"
3230
* Render
3331

3432
* Set test object to "release-name-hull-test-hull-install"
3533

36-
* Test Object has key "spec§template§spec§containers§0§volumeMounts" with array value that has "6" items
34+
* Test Object has key "spec§template§spec§containers§0§volumeMounts" with array value that has "5" items
3735
* Test Object has key "spec§template§spec§containers§0§volumeMounts§0§name" with value "certs"
3836
* 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"
3937
* Test Object has key "spec§template§spec§containers§0§volumeMounts§1§name" with value "certs"
4038
* Test Object has key "spec§template§spec§containers§0§volumeMounts§1§mountPath" with value "/usr/local/share/ca-certificates/custom-ca-certificates-test_cert_2"
41-
* Test Object has key "spec§template§spec§containers§0§volumeMounts§2§name" with value "custom-installation-files"
42-
* Test Object has key "spec§template§spec§containers§0§volumeMounts§2§mountPath" with value "/custom-installation-files"
43-
* Test Object has key "spec§template§spec§containers§0§volumeMounts§3§name" with value "etcssl"
44-
* 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"
39+
* Test Object has key "spec§template§spec§containers§0§volumeMounts§2§name" with value "etcssl"
40+
* Test Object has key "spec§template§spec§containers§0§volumeMounts§2§mountPath" with value "/etc/ssl/certs"
41+
* Test Object has key "spec§template§spec§containers§0§volumeMounts§3§name" with value "installation"
42+
* Test Object has key "spec§template§spec§containers§0§volumeMounts§3§mountPath" with value "/script/installation.yaml"
43+
* Test Object has key "spec§template§spec§containers§0§volumeMounts§3§subPath" with value "installation.yaml"
4844

49-
* Test Object has key "spec§template§spec§volumes" with array value that has "5" items
45+
* Test Object has key "spec§template§spec§volumes" with array value that has "4" items
5046
* Test Object has key "spec§template§spec§volumes§0§name" with value "certs"
51-
* Test Object has key "spec§template§spec§volumes§1§name" with value "custom-installation-files"
52-
* Test Object has key "spec§template§spec§volumes§2§name" with value "etcssl"
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"
47+
* Test Object has key "spec§template§spec§volumes§1§name" with value "etcssl"
48+
* Test Object has key "spec§template§spec§volumes§2§name" with value "installation"
49+
* Test Object has key "spec§template§spec§volumes§3§name" with value "oci-license"
5550

5651
* Set test object to "release-name-hull-test-custom-ca-certificates" of kind "Secret"
5752
* Test Object has key "data§test_cert_1" with Base64 encoded value of "CERT-DATA-1"
@@ -62,38 +57,35 @@ Test creation of objects and features.
6257

6358
* Set test object to "release-name-hull-test-hull-install"
6459

65-
* Test Object has key "spec§template§spec§containers§0§volumeMounts" with array value that has "7" items
60+
* Test Object has key "spec§template§spec§containers§0§volumeMounts" with array value that has "6" items
6661
* Test Object has key "spec§template§spec§containers§0§volumeMounts§0§name" with value "certs-opensearch"
6762
* 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"
6863
* Test Object has key "spec§template§spec§containers§0§volumeMounts§1§name" with value "certs-opensearch"
6964
* Test Object has key "spec§template§spec§containers§0§volumeMounts§1§mountPath" with value "/usr/local/share/ca-certificates/custom-ca-certificates-opensearch-os.tls"
7065
* Test Object has key "spec§template§spec§containers§0§volumeMounts§2§name" with value "certs-storage"
7166
* Test Object has key "spec§template§spec§containers§0§volumeMounts§2§mountPath" with value "/usr/local/share/ca-certificates/custom-ca-certificates-storage-storage.tls"
72-
* Test Object has key "spec§template§spec§containers§0§volumeMounts§3§name" with value "custom-installation-files"
73-
* Test Object has key "spec§template§spec§containers§0§volumeMounts§3§mountPath" with value "/custom-installation-files"
74-
* Test Object has key "spec§template§spec§containers§0§volumeMounts§4§name" with value "etcssl"
75-
* 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"
67+
* Test Object has key "spec§template§spec§containers§0§volumeMounts§3§name" with value "etcssl"
68+
* Test Object has key "spec§template§spec§containers§0§volumeMounts§3§mountPath" with value "/etc/ssl/certs"
69+
* Test Object has key "spec§template§spec§containers§0§volumeMounts§4§name" with value "installation"
70+
* Test Object has key "spec§template§spec§containers§0§volumeMounts§4§mountPath" with value "/script/installation.yaml"
71+
* Test Object has key "spec§template§spec§containers§0§volumeMounts§4§subPath" with value "installation.yaml"
7972

80-
* Test Object has key "spec§template§spec§volumes" with array value that has "6" items
73+
* Test Object has key "spec§template§spec§volumes" with array value that has "5" items
8174
* Test Object has key "spec§template§spec§volumes§0§name" with value "certs-opensearch"
8275
* Test Object has key "spec§template§spec§volumes§0§secret§secretName" with value "opensearch-node-certs"
8376
* Test Object has key "spec§template§spec§volumes§1§name" with value "certs-storage"
8477
* Test Object has key "spec§template§spec§volumes§1§secret§secretName" with value "storage-server-secret"
85-
* Test Object has key "spec§template§spec§volumes§2§name" with value "custom-installation-files"
86-
* Test Object has key "spec§template§spec§volumes§3§name" with value "etcssl"
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"
78+
* Test Object has key "spec§template§spec§volumes§2§name" with value "etcssl"
79+
* Test Object has key "spec§template§spec§volumes§3§name" with value "installation"
80+
* Test Object has key "spec§template§spec§volumes§4§name" with value "oci-license"
8981

9082

9183
* Prepare default test case for this kind including suites "pod,certificatesecrets,customcacertificates"
9284
* Render
9385

9486
* Set test object to "release-name-hull-test-hull-install"
9587

96-
* Test Object has key "spec§template§spec§containers§0§volumeMounts" with array value that has "9" items
88+
* Test Object has key "spec§template§spec§containers§0§volumeMounts" with array value that has "8" items
9789
* Test Object has key "spec§template§spec§containers§0§volumeMounts§0§name" with value "certs-opensearch"
9890
* 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"
9991
* Test Object has key "spec§template§spec§containers§0§volumeMounts§1§name" with value "certs-opensearch"
@@ -104,24 +96,21 @@ Test creation of objects and features.
10496
* Test Object has key "spec§template§spec§containers§0§volumeMounts§3§mountPath" with value "/usr/local/share/ca-certificates/custom-ca-certificates-test_cert_1"
10597
* Test Object has key "spec§template§spec§containers§0§volumeMounts§4§name" with value "certs"
10698
* Test Object has key "spec§template§spec§containers§0§volumeMounts§4§mountPath" with value "/usr/local/share/ca-certificates/custom-ca-certificates-test_cert_2"
107-
* Test Object has key "spec§template§spec§containers§0§volumeMounts§5§name" with value "custom-installation-files"
108-
* Test Object has key "spec§template§spec§containers§0§volumeMounts§5§mountPath" with value "/custom-installation-files"
109-
* Test Object has key "spec§template§spec§containers§0§volumeMounts§6§name" with value "etcssl"
110-
* 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"
114-
115-
* Test Object has key "spec§template§spec§volumes" with array value that has "7" items
99+
* Test Object has key "spec§template§spec§containers§0§volumeMounts§5§name" with value "etcssl"
100+
* Test Object has key "spec§template§spec§containers§0§volumeMounts§5§mountPath" with value "/etc/ssl/certs"
101+
* Test Object has key "spec§template§spec§containers§0§volumeMounts§6§name" with value "installation"
102+
* Test Object has key "spec§template§spec§containers§0§volumeMounts§6§mountPath" with value "/script/installation.yaml"
103+
* Test Object has key "spec§template§spec§containers§0§volumeMounts§6§subPath" with value "installation.yaml"
104+
105+
* Test Object has key "spec§template§spec§volumes" with array value that has "6" items
116106
* Test Object has key "spec§template§spec§volumes§0§name" with value "certs"
117107
* Test Object has key "spec§template§spec§volumes§1§name" with value "certs-opensearch"
118108
* Test Object has key "spec§template§spec§volumes§1§secret§secretName" with value "opensearch-node-certs"
119109
* Test Object has key "spec§template§spec§volumes§2§name" with value "certs-storage"
120110
* Test Object has key "spec§template§spec§volumes§2§secret§secretName" with value "storage-server-secret"
121-
* Test Object has key "spec§template§spec§volumes§3§name" with value "custom-installation-files"
122-
* Test Object has key "spec§template§spec§volumes§4§name" with value "etcssl"
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"
111+
* Test Object has key "spec§template§spec§volumes§3§name" with value "etcssl"
112+
* Test Object has key "spec§template§spec§volumes§4§name" with value "installation"
113+
* Test Object has key "spec§template§spec§volumes§5§name" with value "oci-license"
125114

126115
___
127116

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

Lines changed: 1 addition & 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 "13" objects were rendered
9+
* Expected number of "12" objects were rendered
1010
* Validate
1111

1212
## Metadata

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ hull:
516516
helm.sh/hook-delete-policy: before-hook-creation
517517

518518
'custom-installation-files':
519+
enabled: _HT?gt (len ((index . "$").Files.Glob "files/hull-vidispine-addon/installation/sources/*")) 0
519520
sources:
520521
- custom-installation-files-setup
521522
- _HULL_OBJECT_TYPE_DEFAULT_

hull-vidispine-addon/templates/_transformations.tpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,12 @@ Icon: |-
112112
{
113113
"secret":{ "secretName": "hull-install" }
114114
},
115+
{{ if (gt (len ($parent.Files.Glob "files/hull-vidispine-addon/installation/sources/*")) 0) }}
115116
"custom-installation-files":
116117
{
117118
"secret": { "secretName": "custom-installation-files" }
118119
},
120+
{{ end }}
119121
"etcssl":
120122
{
121123
"enabled": {{ if (or $parent.Values.hull.config.general.data.installation.config.customCaCertificates $parent.Values.hull.config.general.data.installation.config.certificateSecrets) }}true{{ else }}false{{ end }},
@@ -177,11 +179,13 @@ Icon: |-
177179
"subPath": "Installer.ps1"
178180
},
179181
{{ end }}
182+
{{ if (gt (len ($parent.Files.Glob "files/hull-vidispine-addon/installation/sources/*")) 0) }}
180183
"custom-installation-files":
181184
{
182185
"name": "custom-installation-files",
183186
"mountPath": "/custom-installation-files"
184187
},
188+
{{ end }}
185189
"etcssl":
186190
{
187191
"enabled": {{ if (or $parent.Values.hull.config.general.data.installation.config.customCaCertificates $parent.Values.hull.config.general.data.installation.config.certificateSecrets) }}true{{ else }}false{{ end }},

0 commit comments

Comments
 (0)