Serge Bazanski | 9f0e1e8 | 2023-03-31 22:36:54 +0000 | [diff] [blame] | 1 | { hscloud, pkgs, hscloudForPkgs, ... }: |
| 2 | |
| 3 | { |
| 4 | # Used by clustercfg to figure out which machines need kube certs. |
| 5 | kubeMachineNames = let |
| 6 | isKubeMachine = n: value: |
| 7 | n != "__readTree" && |
| 8 | (builtins.hasAttr "hscloud" value.options) && |
| 9 | (builtins.hasAttr "kube" value.options.hscloud) && |
| 10 | value.options.hscloud.kube.control.enable.value; |
| 11 | machines = pkgs.lib.filterAttrs isKubeMachine hscloud.ops.machines; |
| 12 | names = pkgs.lib.mapAttrsToList (name: _: name) machines; |
| 13 | in names; |
| 14 | } |