Skip to content

Commit

Permalink
Use rsync to copy pack contents
Browse files Browse the repository at this point in the history
  • Loading branch information
cognifloyd committed Apr 12, 2024
1 parent ef1ed63 commit c7e9f09
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Stop generating the DataStore Secret (#385) and checksum labels (#391) when existing secret provided or disabled (by @bmarick)
* Stop generating the checksum labels for Auth Secret (#392) when existing secret provided or disabled (by @bmarick)
* Use `image.pullPolicy` for all containers including init containers that use `image.utilityImage`. (#397) (by @jk464)
* Use `rsync` to copy pack contents when available, falling back to `cp`. (#414) (by @cognifloyd)

## v1.0.0
* Bump to latest CircleCI orb versions ([email protected] and [email protected] by @ZoeLeah)
Expand Down
30 changes: 22 additions & 8 deletions templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,14 @@ Merge packs and virtualenvs from st2 with those from st2packs images
command:
- 'sh'
- '-ec'
- |
/bin/cp -aR /opt/stackstorm/packs/. /opt/stackstorm/packs-shared &&
/bin/cp -aR /opt/stackstorm/virtualenvs/. /opt/stackstorm/virtualenvs-shared
- >
if command rsync; then
rsync -a /opt/stackstorm/packs/. /opt/stackstorm/packs-shared &&
rsync -a /opt/stackstorm/virtualenvs/. /opt/stackstorm/virtualenvs-shared;
else
/bin/cp -aR /opt/stackstorm/packs/. /opt/stackstorm/packs-shared &&
/bin/cp -aR /opt/stackstorm/virtualenvs/. /opt/stackstorm/virtualenvs-shared;
fi
{{- with .securityContext | default $.Values.st2actionrunner.securityContext | default $.Values.securityContext }}
{{/* st2actionrunner is likely the most permissive so use that if defined. */}}
securityContext: {{- toYaml . | nindent 8 }}
Expand All @@ -365,9 +370,14 @@ Merge packs and virtualenvs from st2 with those from st2packs images
command:
- 'sh'
- '-ec'
- |
/bin/cp -aR /opt/stackstorm/packs/. /opt/stackstorm/packs-shared &&
/bin/cp -aR /opt/stackstorm/virtualenvs/. /opt/stackstorm/virtualenvs-shared
- >
if command rsync; then
rsync -a /opt/stackstorm/packs/. /opt/stackstorm/packs-shared &&
rsync -a /opt/stackstorm/virtualenvs/. /opt/stackstorm/virtualenvs-shared;
else
/bin/cp -aR /opt/stackstorm/packs/. /opt/stackstorm/packs-shared &&
/bin/cp -aR /opt/stackstorm/virtualenvs/. /opt/stackstorm/virtualenvs-shared
fi
{{- with .Values.st2actionrunner.securityContext | default .Values.securityContext }}
{{/* st2actionrunner is likely the most permissive so use that if defined. */}}
securityContext: {{- toYaml . | nindent 8 }}
Expand All @@ -386,8 +396,12 @@ Merge packs and virtualenvs from st2 with those from st2packs images
command:
- 'sh'
- '-ec'
- |
/bin/cp -aR /opt/stackstorm/configs/. /opt/stackstorm/configs-shared
- >
if command rsync; then
rsync -a /opt/stackstorm/configs/. /opt/stackstorm/configs-shared;
else
/bin/cp -aR /opt/stackstorm/configs/. /opt/stackstorm/configs-shared;
fi
{{- with .Values.st2actionrunner.securityContext | default .Values.securityContext }}
{{/* st2actionrunner is likely the most permissive so use that if defined. */}}
securityContext: {{- toYaml . | nindent 8 }}
Expand Down

0 comments on commit c7e9f09

Please sign in to comment.