Skip to content

Development Guide

Required: Go 1.26.1+ (go version ≥ 1.26.1), Docker (docker ps without errors), Git.

Optional: Node.js 24 (docs), golangci-lint, VSCode with Go extension.

Terminal window
git clone https://github.com/devantler-tech/ksail.git
cd ksail
Terminal window
go mod download
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest # optional
cd docs/ && npm ci && cd .. # docs only
Terminal window
go build -o ksail && ./ksail --version
Terminal window
go test ./... # all tests
go test ./pkg/svc/provisioner/cluster/kind # specific package
go test -cover ./... # with coverage
go test -bench=. -benchmem ./pkg/client/helm # benchmarks
Terminal window
golangci-lint run # all linters
golangci-lint run --fix # auto-fix (import order, etc.)

See CONTRIBUTING.md for the full package structure and descriptions of each package. internal/ packages can only be imported within the ksail module; pkg/ packages are public. Circular dependencies are not allowed.

Create a feature branch, make focused atomic changes, write tests, and update docs:

Terminal window
go test ./... && golangci-lint run && go build -o ksail
./ksail cluster init # Smoke test
git add . && git commit -m "feat: add widget to cluster create" && git push origin feature/my-feature

Commit types: feat, fix, docs, refactor, test, chore, perf. Open a PR with a clear description and ensure CI passes.

For Go style, naming conventions, error handling, testing patterns, and implementation guidelines, see CONTRIBUTING.md § Code Style.

Terminal window
cd docs/
npm ci # install dependencies
npm run dev # serve at http://localhost:4321
npm run build # build to docs/dist/
npm run preview # preview production build

KSail doesn't have built-in debug logging yet. Use temporary fmt.Printf("DEBUG: value = %+v\n", value) statements or the Delve debugger:

Terminal window
go install github.com/go-delve/delve/cmd/dlv@latest
dlv test -- -test.run TestName # debug a test
dlv exec ./ksail -- cluster create # debug the binary

VSCode users can set breakpoints and press F5 with a .vscode/launch.json configuration.

| Error | Fix | |-------|-----| | "Docker not available" | Verify Docker is running: docker ps. Check Docker Desktop is started (macOS/Windows) or socket permissions (Linux). | | "Go version mismatch" | Run go version — must be 1.26.1+. Update from go.dev/dl. | | "Import cycle not allowed" | Move shared types to pkg/apis/ or a utility package. Avoid circular imports. | | "Linter failures" | Run golangci-lint run --fix to auto-fix. Check .golangci.yml for enabled linters; some issues require manual fixes. |

CI runs on pull requests and merges to main (build, test, lint, benchmark regression). Releases are automated — push to main triggers tagging, which triggers GoReleaser publishing. For workflow details, see the CI section in CONTRIBUTING.md; for the full release process, see Release Process.

Discussions · Issues · Documentation · CONTRIBUTING.md