From 6073480bee856f372df15a6fd69cf763f28e6c40 Mon Sep 17 00:00:00 2001 From: alex-vmw <36181540+alex-vmw@users.noreply.github.com> Date: Fri, 29 Sep 2023 14:29:38 -0700 Subject: [PATCH] fix: fix empty space formatting issue in the rsync job helm template (#250) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: fix empty space formatting issue in the rsync job helm template Signed-off-by: Alex Romanenko --------- Signed-off-by: Alex Romanenko --- helm/pv-migrate/templates/rsync/job.yaml | 2 +- integration/integration_test.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/helm/pv-migrate/templates/rsync/job.yaml b/helm/pv-migrate/templates/rsync/job.yaml index 71ac5af97..943b9e40d 100644 --- a/helm/pv-migrate/templates/rsync/job.yaml +++ b/helm/pv-migrate/templates/rsync/job.yaml @@ -38,7 +38,7 @@ spec: rc=1 retries={{ .Values.rsync.maxRetries }} period={{ .Values.rsync.retryPeriodSeconds }} - {{- if .Values.rsync.fixPrivateKeyPerms -}} + {{ if .Values.rsync.fixPrivateKeyPerms -}} chmod 400 {{ .Values.rsync.privateKeyMountPath }} {{- end }} until [ "$n" -ge "$retries" ] diff --git a/integration/integration_test.go b/integration/integration_test.go index 84d778ef1..a991ff9b3 100644 --- a/integration/integration_test.go +++ b/integration/integration_test.go @@ -52,6 +52,8 @@ const ( migrateCmdlineWithNetpols = migrateCmdline + "--helm-set rsync.networkPolicy.enabled=true " + "--helm-set sshd.networkPolicy.enabled=true" + migrateCmdlineWithNetpolsAndRsyncFixPrivateKeyPerms = migrateCmdlineWithNetpols + + " --helm-set rsync.fixPrivateKeyPerms=true" ) var ( @@ -177,7 +179,7 @@ func TestSameNSLbSvc(t *testing.T) { _, err := execInPod(ctx, mainClusterCli, ns1, "dest", generateExtraDataShellCommand) assert.NoError(t, err) - cmd := fmt.Sprintf("%s -s lbsvc -i -n %s -N %s --lbsvc-timeout 5m source dest", migrateCmdlineWithNetpols, ns1, ns1) + cmd := fmt.Sprintf("%s -s lbsvc -i -n %s -N %s --lbsvc-timeout 5m source dest", migrateCmdlineWithNetpolsAndRsyncFixPrivateKeyPerms, ns1, ns1) assert.NoError(t, runCliApp(ctx, cmd)) stdout, err := execInPod(ctx, mainClusterCli, ns1, "dest", printDataUIDGIDContentShellCommand)