Shared Go packages for cocoonstack services.
meta-- shared annotation keys, label keys, toleration keys, and VM naming rulesk8s-- Kubernetes client config bootstrap with the standard kubeconfig fallback chainlog-- common log setup for cocoonstack binaries usingprojecteru2/core/log
This repository keeps cross-project contracts in one place instead of re-exporting them from cocoon-operator. cocoon-operator, cocoon-webhook, glance, and vk-cocoon all consume the same package set directly.
go get github.com/cocoonstack/cocoon-common@latestgit clone https://github.com/cocoonstack/cocoon-common.git
cd cocoon-common
make buildUse meta for:
- Cocoon annotation and label constants
- stable VM naming helpers
- slot extraction and role inference
- toolbox connection type detection
Use k8s.LoadConfig() to resolve cluster configuration from:
KUBECONFIG~/.kube/config- in-cluster config
Use log.Setup(ctx, envVar) to initialize the shared logger from an environment variable, defaulting to info.
make build # build all packages
make test # run tests with coverage
make lint # run golangci-lint
make fmt # format code
make help # show all targets| Project | Role |
|---|---|
| cocoon-operator | CocoonSet and Hibernation controllers |
| cocoon-webhook | Admission webhook for sticky scheduling |
| epoch | Snapshot registry and storage backend |
| vk-cocoon | Virtual kubelet provider |