mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 08:00:06 +01:00
make JSON writing optional
allow to pass `writeJSON = false;` and get the raw data instead. This is useful if one wants to avoid writing secrets in the /nix/store. Instead, use `nix-instantiate --strict --eval --json`.
This commit is contained in:
parent
e63348ba97
commit
56d783f547
1 changed files with 8 additions and 2 deletions
10
default.nix
10
default.nix
|
|
@ -47,7 +47,8 @@ let
|
||||||
buildResources = {
|
buildResources = {
|
||||||
configuration ? {},
|
configuration ? {},
|
||||||
resourceFilter ? groupName: name: resource: true,
|
resourceFilter ? groupName: name: resource: true,
|
||||||
withDependencies ? true
|
withDependencies ? true,
|
||||||
|
writeJSON ? true
|
||||||
}: let
|
}: let
|
||||||
evaldConfiguration = evalKubernetesModules configuration;
|
evaldConfiguration = evalKubernetesModules configuration;
|
||||||
|
|
||||||
|
|
@ -96,7 +97,12 @@ let
|
||||||
metadata.labels."kubenix/build" = listHash;
|
metadata.labels."kubenix/build" = listHash;
|
||||||
}) kubernetesList.items;
|
}) kubernetesList.items;
|
||||||
};
|
};
|
||||||
in pkgs.writeText "resources.json" (builtins.toJSON hashedList);
|
|
||||||
|
result = if writeJSON then
|
||||||
|
pkgs.writeText "resources.json" (builtins.toJSON hashedList)
|
||||||
|
else hashedList;
|
||||||
|
in
|
||||||
|
result;
|
||||||
|
|
||||||
buildTest = test: version: buildResources {
|
buildTest = test: version: buildResources {
|
||||||
configuration = {
|
configuration = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue