mirror of
https://git.sr.ht/~goorzhel/turboprop
synced 2024-12-14 11:37:37 +00:00
Factor out values-gathering
This commit is contained in:
parent
29e6ef6c4f
commit
1826882c13
3 changed files with 6 additions and 7 deletions
|
@ -27,7 +27,7 @@
|
|||
// flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
kubelib = nix-kube-generators.lib {inherit pkgs;};
|
||||
lib = import ./lib {inherit pkgs;};
|
||||
lib = import ./lib {inherit kubelib pkgs;};
|
||||
|
||||
downloadCharts = reponame: charts:
|
||||
builtins.mapAttrs
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{pkgs}: {
|
||||
{kubelib, pkgs}: {
|
||||
getValues = path: builtins.elemAt (kubelib.fromYAML (builtins.readFile path)) 0;
|
||||
yamlFile = {
|
||||
pname,
|
||||
url,
|
||||
|
|
|
@ -2,16 +2,14 @@
|
|||
name,
|
||||
namespace,
|
||||
charts,
|
||||
lib,
|
||||
kubelib,
|
||||
...
|
||||
}:
|
||||
# TODO: This seems generic enough to be refactored somehow, provided I can
|
||||
# separate the values into their own files. (They could be Nix files. I was
|
||||
# fretting over a convoluted YAML-to-JSON pipeline earlier.)
|
||||
# TODO: Wait, kubelib has fromYAML.
|
||||
# TODO: This seems generic enough to be refactored somehow.
|
||||
kubelib.buildHelmChart {
|
||||
inherit name namespace;
|
||||
chart = charts.bjw-s.app-template;
|
||||
|
||||
values = builtins.elemAt (kubelib.fromYAML (builtins.readFile ./values.yaml)) 0;
|
||||
values = lib.getValues ./values.yaml;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue