Skip to content

Commit c7e9f09

Browse files
committed
Use rsync to copy pack contents
1 parent ef1ed63 commit c7e9f09

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Stop generating the DataStore Secret (#385) and checksum labels (#391) when existing secret provided or disabled (by @bmarick)
77
* Stop generating the checksum labels for Auth Secret (#392) when existing secret provided or disabled (by @bmarick)
88
* Use `image.pullPolicy` for all containers including init containers that use `image.utilityImage`. (#397) (by @jk464)
9+
* Use `rsync` to copy pack contents when available, falling back to `cp`. (#414) (by @cognifloyd)
910

1011
## v1.0.0
1112
* Bump to latest CircleCI orb versions ([email protected] and [email protected] by @ZoeLeah)

templates/_helpers.tpl

+22-8
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,14 @@ Merge packs and virtualenvs from st2 with those from st2packs images
343343
command:
344344
- 'sh'
345345
- '-ec'
346-
- |
347-
/bin/cp -aR /opt/stackstorm/packs/. /opt/stackstorm/packs-shared &&
348-
/bin/cp -aR /opt/stackstorm/virtualenvs/. /opt/stackstorm/virtualenvs-shared
346+
- >
347+
if command rsync; then
348+
rsync -a /opt/stackstorm/packs/. /opt/stackstorm/packs-shared &&
349+
rsync -a /opt/stackstorm/virtualenvs/. /opt/stackstorm/virtualenvs-shared;
350+
else
351+
/bin/cp -aR /opt/stackstorm/packs/. /opt/stackstorm/packs-shared &&
352+
/bin/cp -aR /opt/stackstorm/virtualenvs/. /opt/stackstorm/virtualenvs-shared;
353+
fi
349354
{{- with .securityContext | default $.Values.st2actionrunner.securityContext | default $.Values.securityContext }}
350355
{{/* st2actionrunner is likely the most permissive so use that if defined. */}}
351356
securityContext: {{- toYaml . | nindent 8 }}
@@ -365,9 +370,14 @@ Merge packs and virtualenvs from st2 with those from st2packs images
365370
command:
366371
- 'sh'
367372
- '-ec'
368-
- |
369-
/bin/cp -aR /opt/stackstorm/packs/. /opt/stackstorm/packs-shared &&
370-
/bin/cp -aR /opt/stackstorm/virtualenvs/. /opt/stackstorm/virtualenvs-shared
373+
- >
374+
if command rsync; then
375+
rsync -a /opt/stackstorm/packs/. /opt/stackstorm/packs-shared &&
376+
rsync -a /opt/stackstorm/virtualenvs/. /opt/stackstorm/virtualenvs-shared;
377+
else
378+
/bin/cp -aR /opt/stackstorm/packs/. /opt/stackstorm/packs-shared &&
379+
/bin/cp -aR /opt/stackstorm/virtualenvs/. /opt/stackstorm/virtualenvs-shared
380+
fi
371381
{{- with .Values.st2actionrunner.securityContext | default .Values.securityContext }}
372382
{{/* st2actionrunner is likely the most permissive so use that if defined. */}}
373383
securityContext: {{- toYaml . | nindent 8 }}
@@ -386,8 +396,12 @@ Merge packs and virtualenvs from st2 with those from st2packs images
386396
command:
387397
- 'sh'
388398
- '-ec'
389-
- |
390-
/bin/cp -aR /opt/stackstorm/configs/. /opt/stackstorm/configs-shared
399+
- >
400+
if command rsync; then
401+
rsync -a /opt/stackstorm/configs/. /opt/stackstorm/configs-shared;
402+
else
403+
/bin/cp -aR /opt/stackstorm/configs/. /opt/stackstorm/configs-shared;
404+
fi
391405
{{- with .Values.st2actionrunner.securityContext | default .Values.securityContext }}
392406
{{/* st2actionrunner is likely the most permissive so use that if defined. */}}
393407
securityContext: {{- toYaml . | nindent 8 }}

0 commit comments

Comments
 (0)