Skip to content

cozystack/cozyvalues-gen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cozyvalues-gen

Tiny helper that turns comment-annotated values.yaml files into:

  1. Go structs – strongly typed, IDE-friendly.
  2. CustomResourceDefinitions (CRD) – produced by controller-gen.
  3. values.schema.json – OpenAPI schema extracted from the CRD.
  4. README.md – auto-updated ## Parameters section.

The chain “structs → CRD → OpenAPI” re-uses the same code that Kubernetes itself relies on, so you get maximum type compatibility for free.


How it works

graph LR
    A[values.yaml] --> B(Go structs)
    B --> C[CRD YAML]
    C --> D[values.schema.json]
    A --> E[README.md]
Loading
  • Annotate your values.yaml (see examples for the exact syntax).
  • Run cozyvalues-gen; it parses the comments and spits out Go code.
  • controller-gen compiles that code, emitting a CRD.
  • The tool trims the CRD down to a Helm-compatible schema.

Usage (one-liner)

cozyvalues-gen \
  --values values.yaml \
  --schema values.schema.json

See cozyvalues-gen -h for all flags.

Installation

Requirements

  • Go toolchain must be installed and accessible via $PATH.

Using go install

go install github.com/cozystack/cozyvalues-gen@latest

The binary lands in $(go env GOPATH)/bin (usually ~/go/bin). Make sure that directory is on your $PATH.

Download a pre‑built release binary

Head over to https://github.com/cozystack/cozyvalues-gen/releases, grab the archive for your OS/arch, unpack it somewhere on your $PATH.


Created for the Cozystack project. 🚀

About

OpenAPI schema and README generator for Helm

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages