Skip to content

Commit 51c78f0

Browse files
authored
Merge pull request #136 from vidispine/release-1.31
reintegrate 1.31 into main
2 parents db5a9e0 + 8a206f0 commit 51c78f0

File tree

8 files changed

+110
-59
lines changed

8 files changed

+110
-59
lines changed

azure-pipelines.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,25 @@ jobs:
5757
dockerRegistryConnection: '${{ parameters.DockerRegistryEndpoint }}'
5858
action: 'Push an image'
5959
imageName: 'hull/hull-integration:$(HULL_VSADDON_VERSION)'
60-
60+
61+
- task: Docker@0
62+
displayName: 'Docker Build noroot'
63+
inputs:
64+
containerregistrytype: 'Container Registry'
65+
dockerRegistryConnection: '${{ parameters.DockerRegistryEndpoint }}'
66+
dockerFile: './images/hull-integration/Dockerfile-noroot'
67+
defaultContext: false
68+
context: './images/hull-integration'
69+
imageName: 'hull/hull-integration:$(HULL_VSADDON_VERSION)-noroot'
70+
71+
- task: Docker@0
72+
displayName: 'Docker Push'
73+
inputs:
74+
containerregistrytype: 'Container Registry'
75+
dockerRegistryConnection: '${{ parameters.DockerRegistryEndpoint }}'
76+
action: 'Push an image'
77+
imageName: 'hull/hull-integration:$(HULL_VSADDON_VERSION)-noroot'
78+
6179
- script: |
6280
CHART_RELEASER_VERSION=1.5.0
6381
set -euo pipefail

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ Test creation of objects and features.
7373
* Test Object has key "spec§template§spec§containers§0§volumeMounts§3§mountPath" with value "/custom-installation-files"
7474
* Test Object has key "spec§template§spec§containers§0§volumeMounts§4§name" with value "etcssl"
7575
* 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"
7679

7780
* Test Object has key "spec§template§spec§volumes" with array value that has "6" items
7881
* Test Object has key "spec§template§spec§volumes§0§name" with value "certs-opensearch"
@@ -105,6 +108,9 @@ Test creation of objects and features.
105108
* Test Object has key "spec§template§spec§containers§0§volumeMounts§5§mountPath" with value "/custom-installation-files"
106109
* Test Object has key "spec§template§spec§containers§0§volumeMounts§6§name" with value "etcssl"
107110
* 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"
108114

109115
* Test Object has key "spec§template§spec§volumes" with array value that has "7" items
110116
* Test Object has key "spec§template§spec§volumes§0§name" with value "certs"
@@ -119,5 +125,4 @@ Test creation of objects and features.
119125

120126
___
121127

122-
123128
* Clean the test execution folder

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,60 @@ hull:
644644
- custom-installation-files-setup
645645
- _HULL_OBJECT_TYPE_DEFAULT_
646646
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 }}
647701
Installer.ps1:
648702
enabled: _HT*hull.config.general.data.installation.config.debug.debugInstallerScript
649703
inline: |-

hull-vidispine-addon/templates/_library.tpl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -500,12 +500,15 @@ rabbitmq-connectionString:
500500
{{ $endpointApplication := include "hull.vidispine.addon.library.get.endpoint.application" (dict "PARENT_CONTEXT" $parent "ENDPOINT" $databaseKey) }}
501501
serviceAccountName: {{ $serviceAccountName }}
502502
restartPolicy: {{ default "Never" (index . "RESTART_POLICY") }}
503+
securityContext:
504+
runAsNonRoot: true
505+
runAsUser: 1001
503506
initContainers:
504507
{{ if $createScriptConfigMap }}
505508
copy-custom-scripts:
506509
image:
507510
repository: {{ dig "images" "dbTools" "repository" "vpms/dbtools" $parent.Values.hull.config.specific }}
508-
tag: {{ (dig "images" "dbTools" "tag" (dig "tags" "dbTools" "1.9-1" $parent.Values.hull.config.specific) $parent.Values.hull.config.specific) | toString | quote }}
511+
tag: {{ (dig "images" "dbTools" "tag" (dig "tags" "dbTools" "2.0-noroot" $parent.Values.hull.config.specific) $parent.Values.hull.config.specific) | toString | quote }}
509512
args:
510513
- "/bin/sh"
511514
- "-c"
@@ -520,7 +523,7 @@ initContainers:
520523
set-custom-script-permissions:
521524
image:
522525
repository: {{ dig "images" "dbTools" "repository" "vpms/dbtools" $parent.Values.hull.config.specific }}
523-
tag: {{ (dig "images" "dbTools" "tag" (dig "tags" "dbTools" "1.9-1" $parent.Values.hull.config.specific) $parent.Values.hull.config.specific) | toString | quote }}
526+
tag: {{ (dig "images" "dbTools" "tag" (dig "tags" "dbTools" "2.0-noroot" $parent.Values.hull.config.specific) $parent.Values.hull.config.specific) | toString | quote }}
524527
args:
525528
- "/bin/sh"
526529
- "-c"
@@ -533,7 +536,7 @@ initContainers:
533536
check-database-ready:
534537
image:
535538
repository: {{ dig "images" "dbTools" "repository" "vpms/dbtools" $parent.Values.hull.config.specific }}
536-
tag: {{ (dig "images" "dbTools" "tag" (dig "tags" "dbTools" "1.9-1" $parent.Values.hull.config.specific) $parent.Values.hull.config.specific) | toString | quote }}
539+
tag: {{ (dig "images" "dbTools" "tag" (dig "tags" "dbTools" "2.0-noroot" $parent.Values.hull.config.specific) $parent.Values.hull.config.specific) | toString | quote }}
537540
env:
538541
DBHOST:
539542
value: {{ $databaseHost }}
@@ -603,7 +606,7 @@ containers:
603606
{{ end }}
604607
image:
605608
repository: {{ dig "images" "dbTools" "repository" "vpms/dbtools" $parent.Values.hull.config.specific }}
606-
tag: {{ (dig "images" "dbTools" "tag" (dig "tags" "dbTools" "1.9-1" $parent.Values.hull.config.specific) $parent.Values.hull.config.specific) | toString | quote }}
609+
tag: {{ (dig "images" "dbTools" "tag" (dig "tags" "dbTools" "2.0-noroot" $parent.Values.hull.config.specific) $parent.Values.hull.config.specific) | toString | quote }}
607610
env:
608611
DBHOST:
609612
value: {{ $databaseHost }}

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
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM mcr.microsoft.com/powershell:7.3-ubuntu-22.04
2+
RUN pwsh -NonInteractive -Command Install-Module -Force -Scope AllUsers powershell-yaml
3+
RUN apt-get update
4+
RUN apt-get -y install curl
5+
ENV VERSION="1.1.0"
6+
RUN curl -LO "https://github.com/oras-project/oras/releases/download/v${VERSION}/oras_${VERSION}_linux_amd64.tar.gz"
7+
RUN ls
8+
RUN mkdir -p oras-install/
9+
RUN tar -zxf oras_${VERSION}_*.tar.gz -C oras-install/
10+
RUN mv oras-install/oras /usr/local/bin/
11+
RUN rm -rf oras_${VERSION}_*.tar.gz oras-install/
12+
# Create a user group 'noroot'
13+
RUN groupadd noroot
14+
# Add a user noroot to group 'noroot'
15+
RUN useradd --create-home --shell /bin/bash -u 1001 -g noroot noroot
16+
COPY ./Installer.ps1 /script/Installer.ps1
17+
RUN chown -R noroot /script
18+
COPY ./get-custom-scripts /get-custom-scripts
19+
RUN chown -R noroot /get-custom-scripts
20+
RUN oras --help

images/hull-integration/installation.yaml

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

0 commit comments

Comments
 (0)