Skip to content

Commit

Permalink
Remove unused lib code
Browse files Browse the repository at this point in the history
  • Loading branch information
arnarg committed Jul 26, 2024
1 parent 2eb44bd commit 985755a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 55 deletions.
28 changes: 0 additions & 28 deletions lib/helm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,32 +47,4 @@
# Derivation containing helm chart. Usually output of [lib.helm.downloadHelmChart](#libhelmdownloadhelmchart).
chart:
lib.head (klib.fromYAML (builtins.readFile "${chart}/values.yaml"));

mkHelmApplication = {
name,
namespace,
chart,
values ? {},
extrasGenerator ? _: {},
}: let
chartValues = lib.head (klib.fromYAML (builtins.readFile "${chart}/values.yaml"));
finalValues = lib.attrsets.recursiveUpdate chartValues values;
extras = extrasGenerator {
inherit namespace;
values = finalValues;
};

rendered = lib.resources.fromHelmChart {
inherit chart name namespace values;
};

merged = lib.mkMerge [
rendered
(extras.resources or {})
(lib.resources.fromManifestYAMLs (extras.YAMLs or []))
];
in {
inherit namespace;
resources = merged;
};
}
4 changes: 1 addition & 3 deletions lib/kube.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
lib,
klib,
...
}: let
mkManifest = manifest: lib.filterAttrsRecursive (_: v: v != null) manifest;
in {
}: {
/*
Parses a YAML document string into a list of attribute sets.
Expand Down
24 changes: 0 additions & 24 deletions lib/kustomize.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,4 @@
${pkgs.kubectl}/bin/kubectl kustomize "${sanitizedPath}" -o "$out"
'';
};

mkKustomizeApplication = {
name,
namespace,
kustomization,
path,
extrasGenerator ? _: {},
}: let
extras = extrasGenerator {inherit namespace;};

rendered = lib.resources.fromKustomization {
inherit name namespace path;
src = kustomization;
};

merged = lib.mkMerge [
rendered
(extras.resources or {})
(lib.resources.fromManifestYAMLs (extras.YAMLs or []))
];
in {
inherit namespace;
resources = merged;
};
}

0 comments on commit 985755a

Please sign in to comment.