diff --git a/Makefile b/Makefile index bcaa3405e..6b1cff7a1 100644 --- a/Makefile +++ b/Makefile @@ -87,8 +87,13 @@ templates: $(yaml_templates) @# Need to prepend each line in the sample config with spaces in order to @# fit correctly in the configmap spec. @sed s'/^/ /' nfd-worker.conf.example > nfd-worker.conf.tmp - @# The quick-n-dirty sed below expects the configmap data to be at the very end of the file - @for f in $+; do sed -e '/nfd-worker\.conf/r nfd-worker.conf.tmp' -e '/nfd-worker\.conf/q' -i $$f; done + @# The sed magic below replaces the block of text between the lines with start and end markers + @for f in $+; do \ + start=NFD-WORKER-CONF-START-DO-NOT-REMOVE; \ + end=NFD-WORKER-CONF-END-DO-NOT-REMOVE; \ + sed -e "/$$start/,/$$end/{ /$$start/{ p; r nfd-worker.conf.tmp" \ + -e "}; /$$end/p; d }" -i $$f; \ + done @rm nfd-worker.conf.tmp mock: diff --git a/nfd-daemonset-combined.yaml.template b/nfd-daemonset-combined.yaml.template index 6af7ff6f3..1e0f1611a 100644 --- a/nfd-daemonset-combined.yaml.template +++ b/nfd-daemonset-combined.yaml.template @@ -141,7 +141,7 @@ metadata: name: nfd-worker-conf namespace: node-feature-discovery data: - nfd-worker.conf: | + nfd-worker.conf: | ### #sources: # cpu: # cpuid: @@ -227,3 +227,4 @@ data: # vendor: ["15b3"] # device: ["1014", "1017"] # loadedKMod : ["vendor_kmod1", "vendor_kmod2"] +### diff --git a/nfd-worker-daemonset.yaml.template b/nfd-worker-daemonset.yaml.template index e6f724ca8..788b596bd 100644 --- a/nfd-worker-daemonset.yaml.template +++ b/nfd-worker-daemonset.yaml.template @@ -101,7 +101,7 @@ metadata: name: nfd-worker-conf namespace: node-feature-discovery data: - nfd-worker.conf: | + nfd-worker.conf: | ### #sources: # cpu: # cpuid: @@ -187,3 +187,4 @@ data: # vendor: ["15b3"] # device: ["1014", "1017"] # loadedKMod : ["vendor_kmod1", "vendor_kmod2"] +### diff --git a/nfd-worker-job.yaml.template b/nfd-worker-job.yaml.template index 8abb4678d..8f752727b 100644 --- a/nfd-worker-job.yaml.template +++ b/nfd-worker-job.yaml.template @@ -111,7 +111,7 @@ metadata: name: nfd-worker-conf namespace: node-feature-discovery data: - nfd-worker.conf: | + nfd-worker.conf: | ### #sources: # cpu: # cpuid: @@ -197,3 +197,4 @@ data: # vendor: ["15b3"] # device: ["1014", "1017"] # loadedKMod : ["vendor_kmod1", "vendor_kmod2"] +###