Use Go 1.27.1 or newer within the Go 1.27 series. The module declares Go 1.27
and selects the Go 1.27.1 toolchain automatically when needed.
Makefile tools are pinned and installed under bin/; changing a version pin
replaces an existing binary on the next invocation of its target.
Getting started locally is pretty easy. You can execute:
make e2e-buildThis installs all required operators an installs the operator within a KinD Cluster. The required binaries are also downloaded.
If you wish to test against a specific Kubernetes version, you can pass that via variable:
KIND_K8S_VERSION="v1.31.0" make e2e-buildWhen you want to quickly develop, you can scale down the operator within the cluster:
kubectl scale deploy observability-addon --replicas=0 -n observability-addonAnd then execute the binary:
go run cmd/main.go -zap-log-level=10You might need to first export the Kubeconfig for the cluster (If you are using multiple clusters at the same time):
bin/kind get kubeconfig --name observability-addon > /tmp/observability-addon
export KUBECONFIG="/tmp/observability-addon"When you are done with the development run the following commands.
For linting:
make golintTo apply formatting and available linter fixes:
make golint-fixThe dependency updates keep k8s.io/kube-openapi at the revision used by
Kubernetes v0.37.1. Newer revisions use structured-merge-diff/v7, which is
incompatible with that Kubernetes release. The transitive github.com/google/cel-go
dependency remains on v0.31.0 because v0.32.0 moved to cel.dev/cel-go, while
Capsule still imports the former module path.
For Unit-Testing
make testFor Unit-Testing (When running Unit-Tests there should not be any argotranslators, tenants and appprojects present):
make e2e-execWhen making changes to the Helm-Chart, Update the documentation by running:
make helm-docsLinting and Testing the chart:
make helm-lint
make helm-testUse PProf for profiling:
curl -s "http://127.0.0.1:8082/debug/pprof/profile" > ./cpu-profile.out
go tool pprof -http=:8080 ./cpu-profile.out