Skip to content

Commit 42bb71e

Browse files
fuweidk8s-infra-cherrypick-robot
authored andcommitted
install-runhcs-shim: fetch target commit instead of tags
No idea why it blames lock during fetching. ```bash ... * [new tag] v0.9.9 -> v0.9.9 error: cannot lock ref 'refs/tags/v0.6.3': Unable to create 'C:/Users/runneradmin/AppData/Local/Temp/tmp.N2FTxfARN9/.git/refs/tags/v0.6.3.lock': File exists. Another git process seems to be running in this repository, e.g. an editor opened by 'git commit'. Please make sure all processes are terminated then try again. If it still fails, a git process may have crashed in this repository earlier: remove the file manually to continue. + cleanup + rm -rf /tmp/tmp.N2FTxfARN9 ``` Signed-off-by: Wei Fu <[email protected]>
1 parent 885991b commit 42bb71e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

script/setup/install-runhcs-shim

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ then
3737
cd "$tmpdir"
3838
git init .
3939
git remote add origin "$RUNHCS_REPO"
40-
git fetch --tags --depth=1 origin ${RUNHCS_VERSION}
40+
git fetch --depth 1 origin ${RUNHCS_VERSION}
41+
git checkout FETCH_HEAD
4142
else
4243
cd "${HCSSHIM_SRC}"
44+
git checkout "refs/tags/${RUNHCS_VERSION}" || git checkout "refs/heads/${RUNHCS_VERSION}" || git checkout "${RUNHCS_VERSION}"
4345
fi
44-
git checkout "refs/tags/${RUNHCS_VERSION}" || git checkout "refs/heads/${RUNHCS_VERSION}" || git checkout "${RUNHCS_VERSION}"
4546
GO111MODULE=on go build -mod=vendor -o "${DESTDIR}/containerd-shim-runhcs-v1.exe" ./cmd/containerd-shim-runhcs-v1

0 commit comments

Comments
 (0)