Skip to content

Commit

Permalink
Fix overriding of DOCKER_IMG_VERSION in Makefile
Browse files Browse the repository at this point in the history
Signed-off-by: Pulkit Jain <pulkit.jain@broadcom.com>
  • Loading branch information
jainpulkit22 committed Jun 25, 2024
1 parent 538df0e commit 8a79ef4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ GOLANGCI_LINT_VERSION := v1.54.0
GOLANGCI_LINT_BINDIR := $(CURDIR)/.golangci-bin
GOLANGCI_LINT_BIN := $(GOLANGCI_LINT_BINDIR)/$(GOLANGCI_LINT_VERSION)/golangci-lint

BUILD_TAG :=
ifndef CUSTOM_BUILD_TAG
BUILD_TAG = $(shell build/images/build-tag.sh)
else
BUILD_TAG = $(CUSTOM_BUILD_TAG)
DOCKER_IMG_VERSION = $(CUSTOM_BUILD_TAG)
endif

DOCKER_BUILD_ARGS :=
ifeq ($(NO_PULL),)
DOCKER_BUILD_ARGS += --pull
Expand All @@ -44,7 +36,6 @@ ifneq ($(NO_CACHE),)
endif
DOCKER_BUILD_ARGS += --build-arg OVS_VERSION=$(OVS_VERSION)
DOCKER_BUILD_ARGS += --build-arg GO_VERSION=$(GO_VERSION)
DOCKER_BUILD_ARGS += --build-arg BUILD_TAG=$(BUILD_TAG)

export CGO_ENABLED

Expand All @@ -53,6 +44,15 @@ all: build

include versioning.mk

BUILD_TAG :=
ifndef CUSTOM_BUILD_TAG
BUILD_TAG = $(shell build/images/build-tag.sh)
else
BUILD_TAG = $(CUSTOM_BUILD_TAG)
DOCKER_IMG_VERSION = $(CUSTOM_BUILD_TAG)
endif
DOCKER_BUILD_ARGS += --build-arg BUILD_TAG=$(BUILD_TAG)

LDFLAGS += $(VERSION_LDFLAGS)

UNAME_S := $(shell uname -s)
Expand Down
2 changes: 1 addition & 1 deletion ci/jenkins/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ function clean_antrea {
for antrea_yml in ${WORKDIR}/*.yml; do
kubectl delete -f $antrea_yml --ignore-not-found=true || true
done
docker images --format "{{.Repository}}:{{.Tag}}" | grep 'antrea'| xargs -r docker rmi || true
docker images --format "{{.Repository}}:{{.Tag}}" | grep '${BUILD_TAG}' | xargs -r docker rmi || true
docker images | grep '<none>' | awk '{print $3}' | xargs -r docker rmi || true
check_and_cleanup_docker_build_cache
}
Expand Down

0 comments on commit 8a79ef4

Please sign in to comment.