1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-14 11:57:51 +00:00

Makefile: add IMAGE_EXTRA_TAG_NAMES variable

Make it possible to create and push multiple container image tags with
single invocation of make.
This commit is contained in:
Markus Lehtonen 2020-09-03 12:07:13 +03:00
parent 265dfae948
commit 4e5df73747
2 changed files with 5 additions and 0 deletions

View file

@ -13,8 +13,10 @@ VERSION := $(shell git describe --tags --dirty --always)
IMAGE_REGISTRY := k8s.gcr.io/nfd
IMAGE_NAME := node-feature-discovery
IMAGE_TAG_NAME := $(VERSION)
IMAGE_EXTRA_TAG_NAMES :=
IMAGE_REPO := $(IMAGE_REGISTRY)/$(IMAGE_NAME)
IMAGE_TAG := $(IMAGE_REPO):$(IMAGE_TAG_NAME)
IMAGE_EXTRA_TAGS := $(foreach tag,$(IMAGE_EXTRA_TAG_NAMES),$(IMAGE_REPO):$(tag))
K8S_NAMESPACE := kube-system
# We use different mount prefix for local and container builds.
@ -47,6 +49,7 @@ image: yamls
$(IMAGE_BUILD_CMD) --build-arg VERSION=$(VERSION) \
--build-arg HOSTMOUNT_PREFIX=$(CONTAINER_HOSTMOUNT_PREFIX) \
-t $(IMAGE_TAG) \
$(foreach tag,$(IMAGE_EXTRA_TAGS),-t $(tag)) \
$(IMAGE_BUILD_EXTRA_OPTS) ./
yamls: $(yaml_instances)
@ -87,6 +90,7 @@ e2e-test:
push:
$(IMAGE_PUSH_CMD) $(IMAGE_TAG)
for tag in $(IMAGE_EXTRA_TAGS); do $(IMAGE_PUSH_CMD) $$tag; done
poll-image:
set -e; \

View file

@ -887,6 +887,7 @@ name of the resulting container image.
| IMAGE_REGISTRY | Container image registry to use | k8s.gcr.io/nfd
| IMAGE_NAME | Container image name | node-feature-discovery
| IMAGE_TAG_NAME | Container image tag name | <nfd version>
| IMAGE_EXTRA_TAG_NAMES | Additional container image tag(s) to create when building image | *empty*
| IMAGE_REPO | Container image repository to use | <IMAGE_REGISTRY>/<IMAGE_NAME>
| IMAGE_TAG | Full image:tag to tag the image with | <IMAGE_REPO>/<IMAGE_NAME>
| K8S_NAMESPACE | nfd-master and nfd-worker namespace | kube-system