mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-05 16:27:05 +00:00
Make host mount prefix configurable in Makefile and Dockerfile
Introduce a new makefile variable and dockerfile build arg named HOSTMOUNT_PREFIX for changing the prefix used for mounting host directories inside the container. Adds a sed rule in Makefile to generate deployment yamls accordingly.
This commit is contained in:
parent
67d7887949
commit
704c81a4d2
2 changed files with 5 additions and 1 deletions
|
@ -12,9 +12,10 @@ RUN go mod download
|
|||
COPY . /go/node-feature-discovery
|
||||
|
||||
ARG NFD_VERSION
|
||||
ARG HOSTMOUNT_PREFIX
|
||||
|
||||
RUN go install \
|
||||
-ldflags "-s -w -X sigs.k8s.io/node-feature-discovery/pkg/version.version=$NFD_VERSION -X sigs.k8s.io/node-feature-discovery/source.pathPrefix=/host-" \
|
||||
-ldflags "-s -w -X sigs.k8s.io/node-feature-discovery/pkg/version.version=$NFD_VERSION -X sigs.k8s.io/node-feature-discovery/source.pathPrefix=$HOSTMOUNT_PREFIX" \
|
||||
./cmd/*
|
||||
RUN install -D -m644 nfd-worker.conf.example /etc/kubernetes/node-feature-discovery/nfd-worker.conf
|
||||
|
||||
|
|
3
Makefile
3
Makefile
|
@ -16,6 +16,7 @@ IMAGE_TAG_NAME := $(VERSION)
|
|||
IMAGE_REPO := $(IMAGE_REGISTRY)/$(IMAGE_NAME)
|
||||
IMAGE_TAG := $(IMAGE_REPO):$(IMAGE_TAG_NAME)
|
||||
K8S_NAMESPACE := kube-system
|
||||
HOSTMOUNT_PREFIX := /host-
|
||||
KUBECONFIG :=
|
||||
E2E_TEST_CONFIG :=
|
||||
|
||||
|
@ -26,6 +27,7 @@ all: image
|
|||
|
||||
image: yamls
|
||||
$(IMAGE_BUILD_CMD) --build-arg NFD_VERSION=$(VERSION) \
|
||||
--build-arg HOSTMOUNT_PREFIX=$(HOSTMOUNT_PREFIX) \
|
||||
-t $(IMAGE_TAG) \
|
||||
$(IMAGE_BUILD_EXTRA_OPTS) ./
|
||||
|
||||
|
@ -38,6 +40,7 @@ yamls: $(yaml_instances)
|
|||
-e s',^(\s*)name: node-feature-discovery # NFD namespace,\1name: ${K8S_NAMESPACE},' \
|
||||
-e s',^(\s*)image:.+$$,\1image: ${IMAGE_TAG},' \
|
||||
-e s',^(\s*)namespace:.+$$,\1namespace: ${K8S_NAMESPACE},' \
|
||||
-e s',^(\s*)mountPath: "/host-,\1mountPath: "${HOSTMOUNT_PREFIX},' \
|
||||
$< > $@
|
||||
|
||||
mock:
|
||||
|
|
Loading…
Add table
Reference in a new issue