1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-14 11:57:51 +00:00
node-feature-discovery/Makefile
Antti Kervinen 9b96407b26 Makefile: create default yamls, configurable namespace
- Create default yamls for deploying master and worker.
- Use kube-system namespace by default.
- Configurable namespace:
  make IMAGE_REGISTRY=myhost:5000 K8S_NAMESPACE=my-nfd-devel
2019-06-05 13:13:53 +03:00

41 lines
1.3 KiB
Makefile

.PHONY: all test yamls
.FORCE:
IMAGE_BUILD_CMD := docker build
VERSION := $(shell git describe --tags --dirty --always)
IMAGE_REGISTRY := quay.io/kubernetes_incubator
IMAGE_NAME := node-feature-discovery
IMAGE_TAG_NAME := $(VERSION)
IMAGE_REPO := $(IMAGE_REGISTRY)/$(IMAGE_NAME)
IMAGE_TAG := $(IMAGE_REPO):$(IMAGE_TAG_NAME)
K8S_NAMESPACE := kube-system
yaml_templates := $(wildcard *.yaml.template)
yaml_instances := $(patsubst %.yaml.template,%.yaml,$(yaml_templates))
all: image
image: yamls
$(IMAGE_BUILD_CMD) --build-arg NFD_VERSION=$(VERSION) \
-t $(IMAGE_TAG) ./
yamls: $(yaml_instances)
%.yaml: %.yaml.template .FORCE
@echo "$@: namespace: ${K8S_NAMESPACE}"
@echo "$@: image: ${IMAGE_TAG}"
@sed -E \
-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},' \
$< > $@
mock:
mockery --name=FeatureSource --dir=source --inpkg --note="Re-generate by running 'make mock'"
mockery --name=APIHelpers --dir=pkg/apihelper --inpkg --note="Re-generate by running 'make mock'"
mockery --name=LabelerClient --dir=pkg/labeler --inpkg --note="Re-generate by running 'make mock'"
test:
go test ./cmd/... ./pkg/...