Skip to content

Commit

Permalink
Merge branch 'main' of github.com:projectcapsule/capsule
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverbaehler committed Oct 28, 2023
2 parents c34f549 + ee991ea commit 0c6307b
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 41 deletions.
27 changes: 1 addition & 26 deletions .github/workflows/helm-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,29 +45,4 @@ jobs:
- name: Run chart-testing (install)
run: make helm-test
if: steps.list-changed.outputs.changed == 'true'

# 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: make helm-test
if: steps.list-changed.outputs.changed == 'true'

## Create KIND Cluster
- name: Create kind cluster
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.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'
if: steps.list-changed.outputs.changed == 'true'
1 change: 1 addition & 0 deletions .ko.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
defaultPlatforms:
- linux/arm64
- linux/amd64
- linux/arm
builds:
- id: capsule
main: ./
Expand Down
27 changes: 13 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Version
GIT_HEAD_COMMIT ?= $(shell git rev-parse --short HEAD)
VERSION ?= $(shell git describe --abbrev=0 --tags --match "v*")
ifndef VERSION
VERSION = $(GIT_HEAD_COMMIT)
endif
VERSION ?= $(or $(shell git describe --abbrev=0 --tags --match "v*" 2>/dev/null),$(GIT_HEAD_COMMIT))

# Defaults
REGISTRY ?= ghcr.io
Expand Down Expand Up @@ -90,6 +87,10 @@ apidoc: apidocs-gen
# Helm
SRC_ROOT = $(shell git rev-parse --show-toplevel)

helm-controller-version:
$(eval VERSION := $(shell grep 'appVersion:' charts/capsule/Chart.yaml | awk '{print "v"$$2}'))
$(eval KO_TAGS := $(shell grep 'appVersion:' charts/capsule/Chart.yaml | awk '{print "v"$$2}'))

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
Expand All @@ -98,10 +99,12 @@ helm-lint: CT_VERSION := v3.3.1
helm-lint: docker
@docker run -v "$(SRC_ROOT):/workdir" --entrypoint /bin/sh quay.io/helmpack/chart-testing:$(CT_VERSION) -c "cd /workdir; ct lint --config .github/configs/ct.yaml --lint-conf .github/configs/lintconf.yaml --all --debug"

helm-test: kind ct ko-build-all
helm-test: helm-controller-version kind ct ko-build-all
@kind create cluster --wait=60s --name capsule-charts
@kind load docker-image --name capsule-charts $(LOCAL_CAPSULE_IMG)
@kind load docker-image --name capsule-charts $(CAPSULE_IMG):$(VERSION)
@kubectl create ns capsule-system
@kubectl create -f https://github.com/cert-manager/cert-manager/releases/download/v1.9.1/cert-manager.crds.yaml
@kubectl create -f https://github.com/prometheus-operator/prometheus-operator/releases/download/v0.58.0/bundle.yaml
@ct install --config $(SRC_ROOT)/.github/configs/ct.yaml --namespace=capsule-system --all --debug
@kind delete cluster --name capsule-charts

Expand Down Expand Up @@ -197,12 +200,10 @@ LD_FLAGS := "-X main.Version=$(VERSION) \
# ------------------

.PHONY: ko-build-capsule
LOCAL_CAPSULE_IMG_BASE := github.com/$(REPOSITORY)
LOCAL_CAPSULE_IMG := $(KO_REGISTRY)/$(LOCAL_CAPSULE_IMG_BASE)
ko-build-capsule: ko
@echo Building Capsule $(KO_TAGS) >&2
@LD_FLAGS=$(LD_FLAGS) KOCACHE=$(KOCACHE) KO_DOCKER_REPO=$(KO_REGISTRY) \
$(KO) build ./ --preserve-import-paths --tags=$(KO_TAGS) --push=false
@LD_FLAGS=$(LD_FLAGS) KOCACHE=$(KOCACHE) KO_DOCKER_REPO=$(CAPSULE_IMG) \
$(KO) build ./ --bare --tags=$(KO_TAGS) --push=false --local

.PHONY: ko-build-all
ko-build-all: ko-build-capsule
Expand Down Expand Up @@ -262,7 +263,7 @@ kustomize: ## Download kustomize locally if necessary.
KO = $(shell pwd)/bin/ko
KO_VERSION = v0.14.1
ko:
$(call go-install-tool,$(KO),github.com/google/ko@v0.14.1)
$(call go-install-tool,$(KO),github.com/google/ko@$(KO_VERSION))

####################
# -- Helpers
Expand Down Expand Up @@ -330,8 +331,6 @@ e2e-install:
--set 'manager.image.pullPolicy=Never' \
--set 'manager.resources=null'\
--set "manager.image.tag=$(VERSION)" \
--set 'manager.image.registry=$(KO_REGISTRY)' \
--set 'manager.image.repository=$(LOCAL_CAPSULE_IMG_BASE)' \
--set 'manager.livenessProbe.failureThreshold=10' \
--set 'manager.readinessProbe.failureThreshold=10' \
--set 'podSecurityContext.seccompProfile=null' \
Expand All @@ -340,7 +339,7 @@ e2e-install:

.PHONY: e2e-load-image
e2e-load-image: ko-build-all
kind load docker-image --nodes capsule-control-plane --name capsule $(LOCAL_CAPSULE_IMG):$(VERSION)
kind load docker-image --nodes capsule-control-plane --name capsule $(CAPSULE_IMG):$(VERSION)

.PHONY: e2e-exec
e2e-exec: ginkgo
Expand Down
2 changes: 1 addition & 1 deletion charts/capsule/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ sources:
version: 0.4.6
# This is the version number of the application being deployed.
# This version number should be incremented each time you make changes to the application.
appVersion: 0.4.0-rc.1
appVersion: 0.4.0-rc.3
annotations:
artifacthub.io/operator: "true"
artifacthub.io/prerelease: "false"
Expand Down
5 changes: 5 additions & 0 deletions docs/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@ export default function (Vue, { router, head, isClient }) {
// Set default layout as a global component
Vue.component('LayoutDefault', DefaultLayout)
Vue.component('LayoutMarkdown', MarkdownLayout)

head.script.push({
src: 'https://www.googletagmanager.com/gtag/js?id=G-ZL1M3TWPY2',
async: true
})
}

0 comments on commit 0c6307b

Please sign in to comment.