@@ -20,6 +20,7 @@ FL2M_BIN_FILE=flowlogs2metrics
2020CG_BIN_FILE =confgenerator
2121NETFLOW_GENERATOR =nflow-generator
2222CMD_DIR =./cmd/
23+ FL2M_CONF_FILE ?= contrib/kubernetes/flowlogs2metrics.conf.yaml
2324
2425.DEFAULT_GOAL := help
2526
@@ -58,7 +59,7 @@ lint: $(GOLANGCI_LINT) ## Lint the code
5859.PHONY : build_code
5960build_code : validate_go lint
6061 @go mod vendor
61- go build " ${CMD_DIR}${FL2M_BIN_FILE} "
62+ VERSION= $$( date ) ; go build -ldflags " -X 'main.Version= $$ VERSION' " " ${CMD_DIR}${FL2M_BIN_FILE} "
6263
6364.PHONY : build
6465build : build_code docs # # Build flowlogs2metrics executable and update the docs
@@ -113,7 +114,7 @@ push-image: build-image ## Push latest image
113114.PHONY : deploy
114115deploy : # # Deploy the image
115116 sed ' s|%DOCKER_IMG%|$(DOCKER_IMG)|g;s|%DOCKER_TAG%|$(DOCKER_TAG)|g' contrib/kubernetes/deployment.yaml > /tmp/deployment.yaml
116- kubectl create configmap flowlogs2metrics-configuration --from-file=flowlogs2metrics.conf.yaml=contrib/kubernetes/flowlogs2metrics.conf.yaml
117+ kubectl create configmap flowlogs2metrics-configuration --from-file=flowlogs2metrics.conf.yaml=$( FL2M_CONF_FILE )
117118 kubectl apply -f /tmp/deployment.yaml
118119 kubectl rollout status " deploy/flowlogs2metrics" --timeout=600s
119120
@@ -177,7 +178,7 @@ delete-kind-cluster: $(KIND) ## Delete cluster
177178generate-configuration : $(KIND ) # # Generate metrics configuration
178179 go build " ${CMD_DIR}${CG_BIN_FILE} "
179180 ./${CG_BIN_FILE} --log-level debug --srcFolder network_definitions \
180- --destConfFile contrib/kubernetes/flowlogs2metrics.conf.yaml \
181+ --destConfFile $( FL2M_CONF_FILE ) \
181182 --destDocFile docs/metrics.md \
182183 --destGrafanaJsonnetFolder contrib/dashboards/jsonnet/
183184
0 commit comments