Skip to content

Commit

Permalink
Refactored Helm lint values override
Browse files Browse the repository at this point in the history
Signed-off-by: Philip Schmid <[email protected]>
  • Loading branch information
PhilipSchmid committed Aug 20, 2024
1 parent 030c6d5 commit 9b69646
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
12 changes: 6 additions & 6 deletions install/kubernetes/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@ KUBECONFORM_VERSION := v0.6.7
PYTHON := python3
PIPENV := pipenv
K8S_VERSION := master
HELM_VALUES_OVERRIDE := "helm_values_override.yaml"

REPO_ROOT := $(shell git rev-parse --show-toplevel)
TETRAGON_CHART := tetragon
CRDS := $(REPO_ROOT)/pkg/k8s/apis/cilium.io/client/crds/v1alpha1
JSON_SCHEMAS := $(REPO_ROOT)/install/kubernetes/schemas

HELM ?= docker run --rm -v $(CURDIR)/$(TETRAGON_CHART):/apps $(HELM_IMAGE)
HELM ?= docker run --rm -v $(CURDIR)/$(TETRAGON_CHART):/apps -v $(CURDIR)/$(HELM_VALUES_OVERRIDE):/$(HELM_VALUES_OVERRIDE) $(HELM_IMAGE)

.PHONY: all
all: deps $(TETRAGON_CHART)/crds-yaml lint docs openapi2jsonschema.py generate-jsonschemas kubeconform

.PHONY: deps
deps:
deps:
$(HELM) dependency update .

.PHONY: lint
Expand Down Expand Up @@ -66,14 +67,13 @@ kubeconform:
@echo "## Testing Helm chart: \"$(TETRAGON_CHART)\""
$(HELM) template $(TETRAGON_CHART) . \
-f values.yaml \
--set crds.installMethod=helm \
--set tracingPolicies.default.enabled=true |\
docker run --rm -i -v $(JSON_SCHEMAS):/schemas $(KUBECONFORM_IMAGE) \
-f /$(HELM_VALUES_OVERRIDE) \
| docker run --rm -i -v $(JSON_SCHEMAS):/schemas $(KUBECONFORM_IMAGE) \
-summary \
-verbose \
-schema-location default \
-schema-location '/schemas/{{ .ResourceKind }}-{{ .Group }}.json' \
-skip CustomResourceDefinition \
-strict \
-kubernetes-version $(K8S_VERSION)
@echo ""
@echo ""
5 changes: 5 additions & 0 deletions install/kubernetes/helm_values_override.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
crds:
installMethod: helm
tracingPolicies:
default:
enabled: true

0 comments on commit 9b69646

Please sign in to comment.