From be50b1a39dec7499e64c37bc8c7a23b6e27ad2b2 Mon Sep 17 00:00:00 2001 From: alex-vmw <36181540+alex-vmw@users.noreply.github.com> Date: Fri, 29 Sep 2023 04:04:45 -0700 Subject: [PATCH] feat: add helm rsync.fixPrivateKeyPerms option (#246) (#247) Signed-off-by: Alex Romanenko --- helm/pv-migrate/README.md | 1 + helm/pv-migrate/templates/rsync/job.yaml | 3 +++ helm/pv-migrate/values.yaml | 2 ++ migrator/helm-chart.tgz | Bin 4794 -> 4869 bytes 4 files changed, 6 insertions(+) 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 1fea13c01ddf1442559e2ab73d405c0c7d478f11..f47c49ca638c1147504e8357a281d43dba025a3d 100644 GIT binary patch delta 4853 zcmVjexg0c! z?uJDI3;@bf)Y_l1e`x>M762X~c=RPJcB)Zjiv;m59Pa_|p@HPGACoyp5)V!nh)e$( z#nFSiO~c`Ecye^4{|<*k_wQ)*bo^j+bUZvBo{SC;#}9_1!+-J7(E}LXF&~X76%z3W z!<}il!hIzPQOYEegi$f^01%gCh61@rr#@i=5~Dd56Iglx0DYh+#uG^8Maq5+aZLE2 z>_2@W7NIT&py4JEvfu)9g{T8$GV+K1a2*0%T+?7f3L2&$;fNQJ08@b{@H|1m0{6%M z&_fA%i@6|-PJiHX?4cwnUWfjXKlDN@0!|XCv)(K)EN~Pcxmqi3r79m&Gw6(F9WV>)#U2B%|tG z5%M6b(0|H{6#nmj4M`6mi^^6c(4EOBOO4$59g8-ItR%hQ5q6O(KWD3 z%sB}$$OVR38bwMifW&bUA&KD=kqbZ|4CJFvB#I#6IKed35FAGs39R+cW35tt$`DSV z*Yg~*3V;7*B)$B51+AwIiU*+azocjyVK_hk?ga?UFENJ@ClR}jF_j(w*5AVk%upn- zmm3vrVGM%`QfC6k2@^yzeyu;3uWMSlMx;rqYK=uCFj&?5nSPzX_p?__o^dP;uXSLF z<~m=Z`2=zU*GNI&fMY3g0ngGXIyYGpc=z4|U4J*7N~wY)_+9NX)-KYbl;EZn~0sn80}4R^3}QQp8XQQxqW@U=A4* zD)T?HyzkE%+lu3Ce&Ip+Y*)3KV^J33qWMLzz+sw?Y=whSHPvAue$~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