mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 16:10:05 +01:00
update contributing guide and format repo
This commit is contained in:
parent
90de01f7d9
commit
1c410a7e03
5 changed files with 48 additions and 20 deletions
6
.vscode/extensions.json
vendored
Normal file
6
.vscode/extensions.json
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"recommendations": [
|
||||||
|
"EditorConfig.EditorConfig",
|
||||||
|
"mkhl.direnv"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -1,25 +1,47 @@
|
||||||
# Contributing
|
# Contributing
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
Do try to format the repo before submission, however.
|
||||||
|
|
||||||
|
nix develop -c treefmt
|
||||||
|
|
||||||
## Kubernetes versions
|
## Kubernetes versions
|
||||||
|
|
||||||
Edit [`./jobs/generators/default.nix`](./jobs/generators/default.nix) and add a block for the new version of Kubernetes in `generate.k8s`. For example:
|
To support a new Kubernetes version:
|
||||||
|
|
||||||
```nix
|
- Edit [`./jobs/generators/default.nix`](./jobs/generators/default.nix) and add a block for the version under `k8s`; for example:
|
||||||
{
|
|
||||||
|
```nix
|
||||||
|
{
|
||||||
name = "v1.23.nix";
|
name = "v1.23.nix";
|
||||||
path = generateK8S "v1.23" (builtins.fetchurl {
|
path = generateK8S "v1.23" (builtins.fetchurl {
|
||||||
url = "https://github.com/kubernetes/kubernetes/raw/v1.23.0/api/openapi-spec/swagger.json";
|
url = "https://github.com/kubernetes/kubernetes/raw/v1.23.0/api/openapi-spec/swagger.json";
|
||||||
sha256 = "0jivg8nlxka1y7gzqpcxkmbvhcbxynyrxmjn0blky30q5064wx2a";
|
sha256 = "0jivg8nlxka1y7gzqpcxkmbvhcbxynyrxmjn0blky30q5064wx2a";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Then build and copy all specs to [`modules/generated/`](./modules/generated/):
|
- Build and copy the updated specs to [`modules/generated/`](./modules/generated/)
|
||||||
|
|
||||||
nix build '.#jobs.x86_64-linux.generators.k8s'
|
nix build '.#jobs.x86_64-linux.generators.k8s'
|
||||||
cp ./result/* modules/generated/
|
cp ./result/* modules/generated/
|
||||||
|
|
||||||
Now add the version in [`./modules/k8s.nix`](./modules/k8s.nix) under `options.kubernetes.version.type` as well as a new check in [`./flake.nix`](./flake.nix) (e.g., `tests-k8s-1_23`).
|
- 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`)
|
||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,8 @@
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
specialArgs = {inherit kubenix;
|
specialArgs = {
|
||||||
|
inherit kubenix;
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -282,7 +282,6 @@ in {
|
||||||
default = null;
|
default = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
customResources = mkOption {
|
customResources = mkOption {
|
||||||
description = "Setup custom resources";
|
description = "Setup custom resources";
|
||||||
type = types.listOf types.attrs;
|
type = types.listOf types.attrs;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue