diff --git a/.github/workflows/helm.yml b/.github/workflows/helm.yml index d26d9fea..69a7b0ae 100644 --- a/.github/workflows/helm.yml +++ b/.github/workflows/helm.yml @@ -42,23 +42,31 @@ jobs: else echo -e '\033[0;32mDocumentation up to date\033[0m ✔' fi - # Create KIND Cluster - - name: Create kind cluster - uses: helm/kind-action@v1.2.0 - if: steps.list-changed.outputs.changed == 'true' - # Install Required Operators/CRDs - - name: Prepare Cluster Operators/CRDs - run: | - # Cert-Manager CRDs - kubectl create -f https://github.com/cert-manager/cert-manager/releases/download/v1.9.1/cert-manager.crds.yaml - - # Prometheus CRDs - kubectl create -f https://github.com/prometheus-operator/prometheus-operator/releases/download/v0.58.0/bundle.yaml - if: steps.list-changed.outputs.changed == 'true' - # Install Charts + + # ATTENTION: This is a workaround for the upcoming ApiVersion Conversions for the capsule CRDs + # With this workflow the current docker image is build and loaded into kind, otherwise the install fails + # In the future this must be removed and the chart-testing-action must be used - name: Run chart-testing (install) - run: ct install --debug --config ./.github/configs/ct.yaml + run: make helm-test if: steps.list-changed.outputs.changed == 'true' + + ## Create KIND Cluster + #- name: Create kind cluster + # uses: helm/kind-action@v1.2.0 + # if: steps.list-changed.outputs.changed == 'true' + ## Install Required Operators/CRDs + #- name: Prepare Cluster Operators/CRDs + # run: | + # # Cert-Manager CRDs + # kubectl create -f https://github.com/cert-manager/cert-manager/releases/download/v1.9.1/cert-manager.crds.yaml + # + # # Prometheus CRDs + # kubectl create -f https://github.com/prometheus-operator/prometheus-operator/releases/download/v0.58.0/bundle.yaml + # if: steps.list-changed.outputs.changed == 'true' + ## Install Charts + #- name: Run chart-testing (install) + # run: ct install --debug --config ./.github/configs/ct.yaml + # if: steps.list-changed.outputs.changed == 'true' release: if: startsWith(github.ref, 'refs/tags/helm-v') runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index d7c49bbe..b9a90ae4 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,3 @@ bin **/*.key .DS_Store *.tgz - -capsule - diff --git a/Makefile b/Makefile index b2d08df0..419f9664 100644 --- a/Makefile +++ b/Makefile @@ -86,8 +86,15 @@ helm-docs: HELMDOCS_VERSION := v1.11.0 helm-docs: docker @docker run -v "$(SRC_ROOT):/helm-docs" jnorwood/helm-docs:$(HELMDOCS_VERSION) --chart-search-root /helm-docs -helm-lint: docker - @docker run -v "$(SRC_ROOT):/workdir" --entrypoint /bin/sh quay.io/helmpack/chart-testing:v3.3.1 -c "cd /workdir && ct lint --config .github/configs/ct.yaml --lint-conf .github/configs/lintconf.yaml --all --debug" +helm-lint: ct + @ct lint --config $(SRC_ROOT)/.github/configs/ct.yaml --lint-conf $(SRC_ROOT)/.github/configs/lintconf.yaml --all --debug + +helm-test: kind ct docker-build + @kind create cluster --wait=60s --name capsule-charts + @kind load docker-image --name capsule-charts ${IMG} + @kubectl create ns capsule-system + @ct install --config $(SRC_ROOT)/.github/configs/ct.yaml --namespace=capsule-system --all --debug + @kind delete cluster --name capsule-charts docker: @hash docker 2>/dev/null || {\ @@ -172,6 +179,14 @@ GINKGO = $(shell pwd)/bin/ginkgo ginkgo: ## Download ginkgo locally if necessary. $(call go-install-tool,$(GINKGO),github.com/onsi/ginkgo/ginkgo@v1.16.5) +CT = $(shell pwd)/bin/ct +ct: ## Download ct locally if necessary. + $(call go-install-tool,$(CT),github.com/helm/chart-testing/v3/ct@v3.7.1) + +KIND = $(shell pwd)/bin/kind +kind: ## Download kind locally if necessary. + $(call go-install-tool,$(KIND),sigs.k8s.io/kind/cmd/kind@v0.17.0) + KUSTOMIZE = $(shell pwd)/bin/kustomize kustomize: ## Download kustomize locally if necessary. $(call install-kustomize,$(KUSTOMIZE),3.8.7) diff --git a/charts/capsule/ci/test-values.yaml b/charts/capsule/ci/test-values.yaml new file mode 100644 index 00000000..54daa068 --- /dev/null +++ b/charts/capsule/ci/test-values.yaml @@ -0,0 +1,9 @@ +fullnameOverride: capsule +manager: + resources: + limits: + cpu: 500m + memory: 512Mi + requests: + cpu: 200m + memory: 128Mi