Skip to content

Commit

Permalink
Remove OFS_DIR and chown for cached runners
Browse files Browse the repository at this point in the history
  • Loading branch information
fabi200123 committed Oct 10, 2024
1 parent fff8fc8 commit 590e2f7
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions cloudconfig/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ set -x
CALLBACK_URL="{{ .CallbackURL }}"
METADATA_URL="{{ .MetadataURL }}"
BEARER_TOKEN="{{ .CallbackToken }}"
{{- if .ExtraContext.OFS_DIR }}
OFS_DIR_E="{{ .ExtraContext.OFS_DIR }}"
{{- end }}
OFS_DIR=${OFS_DIR_E:-"/opt/work"}
if [ -z "$METADATA_URL" ];then
echo "no token is available and METADATA_URL is not set"
Expand Down Expand Up @@ -102,14 +98,6 @@ if [! -d "$RUN_HOME" ];then
sudo ./bin/installdependencies.sh || fail "failed to install dependencies"
else
sendStatus "using cached runner found in $RUN_HOME"
OFS_AVAIL=1
sudo mkdir -p $OFS_DIR/upper-layer $OFS_DIR/work-layer $RUN_HOME
sudo chown {{ .RunnerUsername }}:{{ .RunnerGroup }} -R $OFS_DIR/upper-layer $OFS_DIR/work-layer $RUN_HOME $RUN_HOME
sudo mount -t overlay overlay -o lowerdir=$RUN_HOME,upperdir=$OFS_DIR/upper-layer,workdir=$OFS_DIR/work-layer $RUN_HOME || OFS_AVAIL=0
if [ $OFS_AVAIL -eq 0 ];then
sendStatus "falling back to non-overlayfs mode"
sudo chown {{ .RunnerUsername }}:{{ .RunnerGroup }} -R "$RUN_HOME" || fail "failed to change owner"
fi
cd "$RUN_HOME"
fi
Expand Down

0 comments on commit 590e2f7

Please sign in to comment.