Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Makefile: Run release build as regular user
This fixes an issue where `make release` would fail to build the release binaries, because `go build` would fail with `error obtaining VCS status: exit status 128`. This happens because `go build` in Go v1.18 and newer is invoking `git` as part of the build process. However, due to [CVE-2022-24765](https://github.blog/2022-04-12-git-security-vulnerability-announced/), git v2.35.2 now requires that the current git directory for most commands is owned by the user with which the `git` process is running. Because our containerized build was running as `root` inside of the container, git rightfully refused to work on a tree owned by a non-root user. This commit fixes this issue by creating a release user with the same UID/GID of the current user (assumed to be the user owning the working directory), and running `make` with the permissions of that user instead of running as root. Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
- Loading branch information