From f4e7e7309e14be112c301e45ac79cb4bc6b3d86e Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Tue, 8 Sep 2020 16:24:39 +0300 Subject: [PATCH] Fix up Makefile variable initialization and documentation An attempt to organize the Makefile variables a bit further. The idea is to only document variables that are really intended for build customization and initialize all these variables in the Makefile with '=?' so that they can be specified in the environment (and not just with variable overrides). Thus, this patch drops some variables from the README and change the initialization of some variables in the Makefile so that the two files would be in sync. (cherry picked from commit 890380892d3828885440d88e19573c6179bef0d4) --- Makefile | 8 +++++--- README.md | 6 +----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 814942a77..92023ccee 100644 --- a/Makefile +++ b/Makefile @@ -11,12 +11,14 @@ IMAGE_PUSH_CMD ?= docker push 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_NAME := node-feature-discovery 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. @@ -28,8 +30,8 @@ else endif HOSTMOUNT_PREFIX ?= / -KUBECONFIG := -E2E_TEST_CONFIG := +KUBECONFIG ?= +E2E_TEST_CONFIG ?= LDFLAGS = -ldflags "-s -w -X sigs.k8s.io/node-feature-discovery/pkg/version.version=$(VERSION) -X sigs.k8s.io/node-feature-discovery/source.pathPrefix=$(HOSTMOUNT_PREFIX)" diff --git a/README.md b/README.md index f0bbcc007..af66fb827 100644 --- a/README.md +++ b/README.md @@ -893,17 +893,13 @@ name of the resulting container image. | Variable | Description | Default value | -------------------------- | ----------------------------------------------------------------- | ----------- | -| HOSTMOUNT_PREFIX | Prefix of system directories for feature discovery (local builds) | / -| CONTAINER_HOSTMOUNT_PREFIX | Prefix of system directories for feature discovery (container builds) | <HOSTMOUNT_PREFIX> (*if specified*) /host- (*otherwise*) +| HOSTMOUNT_PREFIX | Prefix of system directories for feature discovery (local builds) | / (*local builds*) /host- (*container builds*) | IMAGE_BUILD_CMD | Command to build the image | docker build | IMAGE_BUILD_EXTRA_OPTS | Extra options to pass to build command | *empty* | IMAGE_PUSH_CMD | Command to push the image to remote registry | docker push | 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 | KUBECONFIG | Kubeconfig for running e2e-tests | *empty* | E2E_TEST_CONFIG | Parameterization file of e2e-tests (see [example](test/e2e/e2e-test-config.exapmle.yaml)) | *empty*