Skip to content

Commit

Permalink
feat: add helm rsync.fixPrivateKeyPerms option (#246) (#247)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Romanenko <[email protected]>
  • Loading branch information
alex-vmw authored Sep 29, 2023
1 parent d37db6c commit be50b1a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions helm/pv-migrate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ The helm chart of pv-migrate
| rsync.command | string | `""` | Full Rsync command and flags |
| rsync.enabled | bool | `false` | Enable creation of Rsync job |
| rsync.extraArgs | string | `""` | Extra args to be appended to the rsync command. Setting this might cause the tool to not function properly. |
| rsync.fixPrivateKeyPerms | bool | `false` | Enable fixing permissions on the private key prior to running rsync |
| rsync.image.pullPolicy | string | `"IfNotPresent"` | Rsync image pull policy |
| rsync.image.repository | string | `"docker.io/utkuozdemir/pv-migrate-rsync"` | Rsync image repository |
| rsync.image.tag | string | `"1.0.0"` | Rsync image tag |
Expand Down
3 changes: 3 additions & 0 deletions helm/pv-migrate/templates/rsync/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ spec:
rc=1
retries={{ .Values.rsync.maxRetries }}
period={{ .Values.rsync.retryPeriodSeconds }}
{{- if .Values.rsync.fixPrivateKeyPerms -}}
chmod 400 {{ .Values.rsync.privateKeyMountPath }}
{{- end }}
until [ "$n" -ge "$retries" ]
do
{{ required ".Values.rsync.command is required!" .Values.rsync.command }} {{ .Values.rsync.extraArgs }} && rc=0 && break
Expand Down
2 changes: 2 additions & 0 deletions helm/pv-migrate/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ rsync:
privateKeyMountPath: /root/.ssh/id_ed25519
# -- The private key content
privateKey: ""
# -- Enable fixing permissions on the private key prior to running rsync
fixPrivateKeyPerms: false
# -- Number of retries to run rsync command
maxRetries: 10
# -- Waiting time between retries
Expand Down
Binary file modified migrator/helm-chart.tgz
Binary file not shown.

0 comments on commit be50b1a

Please sign in to comment.