Skip to content

Commit

Permalink
make: allow running git status during release build
Browse files Browse the repository at this point in the history
Go 1.18 sets the -buildvcs flag to true by default which will stamp VCS
information into the binary, see https://go.dev/doc/go1.18#go-version
for details. However, in the current `make release` target the release
build is performed in a container and the `git status --porcelain`
command executed by `go build` under the hood fails with:

    fatal: unsafe repository ('/cilium-cli' is owned by someone else)
    To add an exception for this directory, call:

    	git config --global --add safe.directory /cilium-cli

Fix this by calling the suggested command in the container to allow
the Go toolchain executing git commands there.

Signed-off-by: Tobias Klauser <[email protected]>
  • Loading branch information
tklauser authored and michi-covalent committed Apr 13, 2022
1 parent 8cb9027 commit 023ccfb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ release:
--rm \
--workdir /cilium \
--volume `pwd`:/cilium docker.io/library/golang:1.18.0-alpine3.15 \
sh -c "apk add --no-cache make git && make local-release VERSION=${VERSION}"
sh -c "apk add --no-cache make git && git config --global --add safe.directory /cilium && make local-release VERSION=${VERSION}"

local-release: clean
for OS in darwin linux windows; do \
Expand Down

0 comments on commit 023ccfb

Please sign in to comment.