mirror of
https://git.sr.ht/~goorzhel/turboprop
synced 2024-12-14 11:37:37 +00:00
Move liftDefault closer to place of use
This commit is contained in:
parent
f8e2703225
commit
813e933d96
2 changed files with 9 additions and 8 deletions
|
@ -9,13 +9,6 @@
|
|||
parseYAMLsFile = p: kubelib.fromYAML (builtins.readFile p);
|
||||
parseYAMLFile = p: builtins.head (parseYAMLsFile p);
|
||||
|
||||
liftDefault = _: mod:
|
||||
# haumea.lib.transformers.liftDefault uses pkgs.lib.attrsets.unionOfDisjoint,
|
||||
# which fails in mkServices because mod.default is a function, not a set.
|
||||
if (mod ? default && builtins.isFunction mod.default)
|
||||
then mod.default
|
||||
else mod;
|
||||
|
||||
# Helm cannot see my cluster from within the sandbox, so it cannot
|
||||
# infer capabilities from it. Therefore, API versions must be gathered
|
||||
# from charts that provide them.
|
||||
|
|
10
src/mk.nix
10
src/mk.nix
|
@ -62,12 +62,20 @@ in {
|
|||
kubeVersion,
|
||||
apiVersions,
|
||||
}: let
|
||||
# haumea's liftDefault uses pkgs.lib.attrsets.unionOfDisjoint,
|
||||
# which fails in mkServices because mod.default is a function (not a set).
|
||||
liftDefault = _: mod:
|
||||
if (mod ? default && builtins.isFunction mod.default)
|
||||
then mod.default
|
||||
else mod;
|
||||
|
||||
modules = haumea.lib.load {
|
||||
src = serviceRoot;
|
||||
inputs = {inherit charts lib pkgs userData;};
|
||||
loader = serviceLoader;
|
||||
transformer = lib.liftDefault;
|
||||
transformer = liftDefault;
|
||||
};
|
||||
|
||||
foldler = acc: modPath: mod: let
|
||||
# Kubernetes clusters often consist of many interdependent services.
|
||||
# By using foldl, these services can be organized into a quasi-DAG,
|
||||
|
|
Loading…
Reference in a new issue