2022-08-11 23:07:20 -04:00
# Contributing
2022-08-11 23:41:33 -04:00
Thanks for your interest in contributing!
We welcome ideas, code, docs, etc -- just open an issue or MR.
## Setup
This project uses [flakes ](https://nixos.wiki/wiki/Flakes ) so a development environment can be created with
nix develop
where you will find a [devshell ](https://numtide.github.io/devshell ) prompt (which supports [direnv ](https://direnv.net/ ) so a one-time `direnv allow` at the base of the repo should automate the dev shell process).
## Commits
There's no formal commit process at this time.
2022-08-12 09:44:26 -04:00
Do try to format the repo with [treefmt ](https://github.com/numtide/treefmt ) before submission, however.
2022-08-11 23:41:33 -04:00
2022-08-13 00:09:36 -04:00
nix fmt
2022-08-11 23:41:33 -04:00
2022-08-11 23:07:20 -04:00
## Kubernetes versions
2022-08-11 23:41:33 -04:00
To support a new Kubernetes version:
- Edit [`./jobs/generators/default.nix` ](./jobs/generators/default.nix ) and add a block for the version under `k8s` ; for example:
2022-08-11 23:07:20 -04:00
2022-08-11 23:41:33 -04:00
```nix
{
name = "v1.23.nix";
path = generateK8S "v1.23" (builtins.fetchurl {
url = "https://github.com/kubernetes/kubernetes/raw/v1.23.0/api/openapi-spec/swagger.json";
sha256 = "0jivg8nlxka1y7gzqpcxkmbvhcbxynyrxmjn0blky30q5064wx2a";
});
}
```
2022-08-11 23:07:20 -04:00
2022-08-11 23:41:33 -04:00
- Build and copy the updated specs to [`modules/generated/` ](./modules/generated/ )
2022-08-11 23:07:20 -04:00
2022-08-11 23:41:33 -04:00
nix build '.#jobs .x86_64-linux.generators.k8s'
cp ./result/* modules/generated/
2022-08-11 23:07:20 -04:00
2022-08-11 23:41:33 -04:00
- Add the version in [`./modules/k8s.nix` ](./modules/k8s.nix ) under `options.kubernetes.version.type`
- Add a new check in [`./flake.nix` ](./flake.nix ) (e.g., `tests-k8s-1_23` )
2022-08-11 23:18:44 -04:00
2022-08-11 23:07:20 -04:00
## Tests
Tests are executed through GitHub actions; see the [workflow definition ](../kubenix/.github/workflows/ci.yml ) for commands.