Skip to content

Commit

Permalink
CI: Helm lint: Remove pipenv dependency
Browse files Browse the repository at this point in the history
Signed-off-by: Philip Schmid <[email protected]>
  • Loading branch information
PhilipSchmid authored and lambdanis committed Aug 23, 2024
1 parent 4b2005e commit a08b42e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 123 deletions.
23 changes: 0 additions & 23 deletions .github/workflows/lint-helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,6 @@ jobs:
echo "Vendored openapi2jsonschema.py script is out of date."
echo "Please run 'make -C install/kubernetes openapi2jsonschema.py' and submit your changes."; exit 1
fi
- name: Setup Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install pipenv
id: install-pipenv
shell: bash
run: |
python -m pip install --upgrade --no-cache-dir pip
python -m pip install --no-cache-dir pipenv
- name: Cache Pipfile
id: cache-pipfile
uses: actions/cache@v4
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-pipenv-${{ hashFiles('Pipfile.lock') }}
- name: Sync Pipfile
id: sync-pipfile
shell: bash
working-directory: install/kubernetes
run: |
pipenv sync --dev --python ${{ env.PYTHON_VERSION }}
- name: Check if vendored CRD JSON schemas are up to date
run: |
make -C install/kubernetes generate-jsonschemas
Expand Down
14 changes: 7 additions & 7 deletions install/kubernetes/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,19 @@ KUBECONFORM_IMAGE=ghcr.io/yannh/kubeconform:v0.6.7-alpine@sha256:824e0c248809e4b
HELMDOCS_IMAGE=docker.io/jnorwood/helm-docs:v1.14.2@sha256:7e562b49ab6b1dbc50c3da8f2dd6ffa8a5c6bba327b1c6335cc15ce29267979c
# renovate: datasource=github-releases depName=yannh/kubeconform
KUBECONFORM_VERSION := v0.6.7
PYTHON := python3
PIPENV := pipenv
# renovate: datasource=docker
PYTHON_IMAGE := docker.io/python:3.12-slim-bookworm
K8S_VERSION := master
HELM_VALUES_OVERRIDE := "helm_lint_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
CRDS_RELATIVE_DIR := pkg/k8s/apis/cilium.io/client/crds/v1alpha1
CRDS := $(REPO_ROOT)/$(CRDS_RELATIVE_DIR)
JSON_SCHEMAS := $(REPO_ROOT)/install/kubernetes/schemas

HELM ?= docker run --rm -v $(CURDIR)/$(TETRAGON_CHART):/apps -v $(CURDIR)/$(HELM_VALUES_OVERRIDE):/$(HELM_VALUES_OVERRIDE) $(HELM_IMAGE)
PYTHON ?= docker run --rm -v $(REPO_ROOT):/code --workdir=/code/install/kubernetes -e FILENAME_FORMAT='{kind}-{fullgroup}' $(PYTHON_IMAGE)

.PHONY: all
all: deps $(TETRAGON_CHART)/crds-yaml lint docs openapi2jsonschema.py generate-jsonschemas kubeconform
Expand Down Expand Up @@ -53,14 +55,12 @@ openapi2jsonschema.py:
curl -sSfLO https://raw.githubusercontent.com/yannh/kubeconform/$(KUBECONFORM_VERSION)/scripts/$@

# To validate (using openapi2jsonschema.py) default Ruleset policies included in the Helm chart, we need to pass the
# JSON schema of the TracingPolicy CRD. This target generates such schema. It requires pipenv to be pre-installed.
# JSON schema of the TracingPolicy CRD. This target generates such schema.
.PHONY: generate-jsonschemas
generate-jsonschemas: $(CRDS)
mkdir -p $(JSON_SCHEMAS)/
pipenv install
FILENAME_FORMAT='{kind}-{fullgroup}' $(PIPENV) run $(PYTHON) openapi2jsonschema.py $(CRDS)/*
$(PYTHON) /bin/bash -c "pip install pyyaml && python /code/install/kubernetes/openapi2jsonschema.py /code/$(CRDS_RELATIVE_DIR)/*"
mv $(REPO_ROOT)/install/kubernetes/*-cilium.io.json $(JSON_SCHEMAS)/
pipenv --rm

.PHONY: kubeconform
kubeconform:
Expand Down
12 changes: 0 additions & 12 deletions install/kubernetes/Pipfile

This file was deleted.

81 changes: 0 additions & 81 deletions install/kubernetes/Pipfile.lock

This file was deleted.

0 comments on commit a08b42e

Please sign in to comment.