diff --git a/helm/pv-migrate/README.md b/helm/pv-migrate/README.md index 63762ea1e..5d799e648 100644 --- a/helm/pv-migrate/README.md +++ b/helm/pv-migrate/README.md @@ -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 | diff --git a/helm/pv-migrate/templates/rsync/job.yaml b/helm/pv-migrate/templates/rsync/job.yaml index 25599252b..71ac5af97 100644 --- a/helm/pv-migrate/templates/rsync/job.yaml +++ b/helm/pv-migrate/templates/rsync/job.yaml @@ -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 diff --git a/helm/pv-migrate/values.yaml b/helm/pv-migrate/values.yaml index 263123912..23139b214 100644 --- a/helm/pv-migrate/values.yaml +++ b/helm/pv-migrate/values.yaml @@ -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 diff --git a/migrator/helm-chart.tgz b/migrator/helm-chart.tgz index 1fea13c01..f47c49ca6 100644 Binary files a/migrator/helm-chart.tgz and b/migrator/helm-chart.tgz differ