Skip to content

Commit be1528f

Browse files
authored
Merge pull request #93 from maiqueb/template-dp-configmap
manifests: template the device plugin config map name
2 parents 7a3e9f2 + fd95793 commit be1528f

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
CNI_MOUNT_PATH ?= /opt/cni/bin
2+
DEVICE_PLUGIN_CONFIG_MAP_NAME ?= macvtap-deviceplugin-config
23

34
IMAGE_NAME ?= macvtap-cni
45
IMAGE_REGISTRY ?= quay.io/kubevirt
@@ -105,7 +106,7 @@ test/unit: $(GO)
105106
$(GO) test ./cmd/... ./pkg/... -v --ginkgo.v
106107

107108
manifests:
108-
IMAGE_REGISTRY=$(IMAGE_REGISTRY) IMAGE_NAME=$(IMAGE_NAME) IMAGE_TAG=$(IMAGE_TAG) CNI_MOUNT_PATH=$(CNI_MOUNT_PATH) NAMESPACE=$(NAMESPACE) IMAGE_PULL_POLICY=$(IMAGE_PULL_POLICY) ./hack/generate-manifests.sh
109+
IMAGE_REGISTRY=$(IMAGE_REGISTRY) IMAGE_NAME=$(IMAGE_NAME) IMAGE_TAG=$(IMAGE_TAG) CNI_MOUNT_PATH=$(CNI_MOUNT_PATH) NAMESPACE=$(NAMESPACE) IMAGE_PULL_POLICY=$(IMAGE_PULL_POLICY) DEVICE_PLUGIN_CONFIG_MAP_NAME=$(DEVICE_PLUGIN_CONFIG_MAP_NAME) ./hack/generate-manifests.sh
109110

110111
vendor: $(GO)
111112
$(GO) mod tidy

hack/generate-manifests.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
set -ex
44

5-
CNI_MOUNT_PATH=${CNI_MOUNT_PATH} # the default is stored in Makefile
6-
NAMESPACE=${NAMESPACE} # the default is store in Makefile
7-
IMAGE_PULL_POLICY=${IMAGE_PULL_POLICY} # the default is store in Makefile
5+
CNI_MOUNT_PATH=${CNI_MOUNT_PATH} # the default is stored in Makefile
6+
NAMESPACE=${NAMESPACE} # the default is stored in Makefile
7+
IMAGE_PULL_POLICY=${IMAGE_PULL_POLICY} # the default is stored in Makefile
8+
DEVICE_PLUGIN_CONFIG_MAP_NAME=${DEVICE_PLUGIN_CONFIG_MAP_NAME} # the default is stored in Makefile
89

910
# compose the full img name - defaults in Makefile
1011
MACVTAP_IMG=${IMAGE_REGISTRY}/${IMAGE_NAME}:${IMAGE_TAG}
@@ -20,5 +21,6 @@ for template in templates/*.in; do
2021
-e "s#{{ .CniMountPath }}#${CNI_MOUNT_PATH}#g" \
2122
-e "s#{{ .Namespace }}#${NAMESPACE}#g" \
2223
-e "s#{{ .ImagePullPolicy }}#${IMAGE_PULL_POLICY}#g" \
24+
-e "s#{{ .DevicePluginConfigName }}#${DEVICE_PLUGIN_CONFIG_MAP_NAME}#g" \
2325
${template} > ${DESTINATION}/${name}
2426
done

templates/macvtap.yaml.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ spec:
2020
command: ["/macvtap-deviceplugin", "-v", "3", "-logtostderr"]
2121
envFrom:
2222
- configMapRef:
23-
name: macvtap-deviceplugin-config
23+
name: '{{ .DevicePluginConfigName }}'
2424
image: '{{ .MacvtapImage }}'
2525
imagePullPolicy: '{{ .ImagePullPolicy }}'
2626
resources:

0 commit comments

Comments
 (0)