From f73713859c1c1307874a86f3edbaf76133aee174 Mon Sep 17 00:00:00 2001 From: Yusuke Kuoka Date: Sat, 27 Aug 2022 07:12:06 +0000 Subject: [PATCH] e2e: Fix workflow for rootless-dind test to actually pass --- test/e2e/e2e_test.go | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index 0e4073ae..4e21edb9 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -915,32 +915,30 @@ func installActionsWorkflow(t *testing.T, testName, runnerLabel, testResultCMNam } } - steps = append(steps, - testing.Step{ - // This might be the easiest way to handle permissions without use of securityContext - // https://stackoverflow.com/questions/50156124/kubernetes-nfs-persistent-volumes-permission-denied#comment107483717_53186320 - Run: sudo + "chmod 777 -R \"${RUNNER_TOOL_CACHE}\" \"${HOME}/.cache\"", - }, - ) if useSudo { steps = append(steps, + testing.Step{ + // This might be the easiest way to handle permissions without use of securityContext + // https://stackoverflow.com/questions/50156124/kubernetes-nfs-persistent-volumes-permission-denied#comment107483717_53186320 + Run: sudo + "chmod 777 -R \"${RUNNER_TOOL_CACHE}\" \"${HOME}/.cache\"", + }, testing.Step{ Run: sudo + "chmod 777 -R \"/var/lib/docker\"", }, + testing.Step{ + // This might be the easiest way to handle permissions without use of securityContext + // https://stackoverflow.com/questions/50156124/kubernetes-nfs-persistent-volumes-permission-denied#comment107483717_53186320 + Run: "ls -lah \"${RUNNER_TOOL_CACHE}\" \"${HOME}/.cache\"", + }, + testing.Step{ + // This might be the easiest way to handle permissions without use of securityContext + // https://stackoverflow.com/questions/50156124/kubernetes-nfs-persistent-volumes-permission-denied#comment107483717_53186320 + Run: "ls -lah \"/var/lib/docker\" || echo ls failed.", + }, ) } steps = append(steps, - testing.Step{ - // This might be the easiest way to handle permissions without use of securityContext - // https://stackoverflow.com/questions/50156124/kubernetes-nfs-persistent-volumes-permission-denied#comment107483717_53186320 - Run: "ls -lah \"${RUNNER_TOOL_CACHE}\" \"${HOME}/.cache\"", - }, - testing.Step{ - // This might be the easiest way to handle permissions without use of securityContext - // https://stackoverflow.com/questions/50156124/kubernetes-nfs-persistent-volumes-permission-denied#comment107483717_53186320 - Run: "ls -lah \"/var/lib/docker\" || echo ls failed.", - }, testing.Step{ Uses: "actions/setup-go@v3", With: &testing.With{