Skip to content

Commit

Permalink
contrib: use a real target for generating configMap
Browse files Browse the repository at this point in the history
As we're actually make-ing a file, use make as intended.

Signed-off-by: crozzy <joseph.crosland@gmail.com>
  • Loading branch information
crozzy committed Nov 5, 2021
1 parent 5c44e70 commit eddad2e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
13 changes: 5 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,11 @@ docs-build:
rsync --recursive --delete-after --exclude 'v4.*' --exclude .git\
./book/ $(DOCS_DIR)/

CONTRIB_DIR ?= contrib/openshift
# Updates the contrib grafana with the contents of the local-dev version to
# avoid maintaining two versions
.PHONY: grafana-configmap-gen
grafana-configmap-gen:
sed "s/GRAFANA_MANIFEST/$$(sed -e 's/[\&/]/\\&/g' -e 's/$$/\\n/' -e 's/^/ /' local-dev/grafana/provisioning/dashboards/dashboard.json | tr -d '\n')/" \
$(CONTRIB_DIR)/grafana/dashboard-clair.configmap.yaml.tpl \
> $(CONTRIB_DIR)/grafana/dashboards/dashboard-clair.configmap.yaml
contrib/openshift/grafana/dashboards/dashboard-clair.configmap.yaml: local-dev/grafana/provisioning/dashboards/dashboard.json contrib/openshift/grafana/dashboard-clair.configmap.yaml.tpl
sed "s/GRAFANA_MANIFEST/$$(sed -e 's/[\&/]/\\&/g' -e 's/$$/\\n/' -e 's/^/ /' $< | tr -d '\n')/" \
$(word 2,$^) \
> $@


# runs unit tests
.PHONY: unit
Expand Down
2 changes: 2 additions & 0 deletions contrib/openshift/grafana/dashboard-clair.configmap.yaml.tpl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# WARNING: This is generated from local-dev/grafana/data/dashboards/dashboard.json
# please modify there and run make contrib/openshift/grafana/dashboards/dashboard-clair.configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# WARNING: This is generated from local-dev/grafana/data/dashboards/dashboard.json
# please modify there and run make contrib/openshift/grafana/dashboards/dashboard-clair.configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down

0 comments on commit eddad2e

Please sign in to comment.