Skip to content

Commit 6ae92a8

Browse files
Merge pull request #5611 from Prashanth684/okd-tpnu-fix
NO-JIRA: Pass TAGS argument to the machine-config-controller image build
2 parents 43fe37f + 29a8566 commit 6ae92a8

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export GOPROXY=https://proxy.golang.org
2626
# this is necessary for running golangci-lint in a container
2727
export GOLANGCI_LINT_CACHE=$(shell echo $${GOLANGCI_LINT_CACHE:-$$GOPATH/cache})
2828

29-
GOTAGS = "containers_image_openpgp exclude_graphdriver_devicemapper exclude_graphdriver_btrfs containers_image_ostree_stub"
29+
GOTAGS = "containers_image_openpgp exclude_graphdriver_devicemapper exclude_graphdriver_btrfs containers_image_ostree_stub $(TAGS)"
3030

3131
all: binaries
3232

hack/build-go.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,5 @@ fi
3737

3838
mkdir -p ${BIN_PATH}
3939

40-
if [[ $WHAT == "machine-config-controller" ]]; then
41-
GOTAGS="containers_image_openpgp exclude_graphdriver_devicemapper exclude_graphdriver_btrfs containers_image_ostree_stub"
42-
fi
43-
4440
echo "Building ${REPO}/${WHAT_PATH} (${VERSION_OVERRIDE}, ${HASH}) for $GOOS/$GOARCH"
4541
GOOS=${GOOS} GOARCH=${GOARCH} go build -mod=vendor -tags="${GOTAGS}" -ldflags "${GLDFLAGS} -s -w" -o ${BIN_PATH}/${WHAT} ${REPO}/${WHAT_PATH}

hack/build-image

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ else:
4141

4242
print(f"HEAD commit: {gitrev}")
4343
args = [podman, 'build', '-t', imgname, '--no-cache', '.']
44+
# Check if TAGS environment variable is set and pass it as a build argument
45+
tags = os.environ.get('TAGS')
46+
if tags:
47+
args.extend(['--build-arg', f'TAGS={tags}'])
4448
# Check if AUTHFILE environment variable is set. Setting this allows the user to specify which file to use
4549
# for the authentication when building the image
4650
authfile = os.environ.get('AUTHFILE')

0 commit comments

Comments
 (0)