mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 21:25:30 +03:00
nixos/kubernetes: refactor feature gates to attrsOf bool, making it possible to disable featureGates
This is a breaking change, requiring users of `featureGates` to change from a `listOf str` to `attrsOf bool`. Before: ```nix featureGates = [ "EphemeralContainers" ]; extraOpts = pkgs.lib.concatStringsSep " " ( [ "--container-runtime=remote" ''--feature-gates="CSIMigration=false"'' }); ``` After: ```nix featureGates = {EphemeralContainers = true; CSIMigration=false;}; ``` This is much nicer, and sets us up for later work of migrating to configuration files for other services, like e.g. has been happening with kubelet (see: #290119). Signed-off-by: Christina Sørensen <christina@cafkafk.com>
This commit is contained in:
parent
8cf30df938
commit
32ca66f3ed
8 changed files with 43 additions and 21 deletions
|
@ -44,10 +44,10 @@ in
|
|||
};
|
||||
|
||||
featureGates = mkOption {
|
||||
description = "List set of feature gates";
|
||||
description = "Attribute set of feature gates.";
|
||||
default = top.featureGates;
|
||||
defaultText = literalExpression "config.${otop.featureGates}";
|
||||
type = listOf str;
|
||||
type = attrsOf bool;
|
||||
};
|
||||
|
||||
kubeconfig = top.lib.mkKubeConfigOptions "Kubernetes controller manager";
|
||||
|
@ -121,8 +121,8 @@ in
|
|||
--bind-address=${cfg.bindAddress} \
|
||||
${optionalString (cfg.clusterCidr!=null)
|
||||
"--cluster-cidr=${cfg.clusterCidr}"} \
|
||||
${optionalString (cfg.featureGates != [])
|
||||
"--feature-gates=${concatMapStringsSep "," (feature: "${feature}=true") cfg.featureGates}"} \
|
||||
${optionalString (cfg.featureGates != {})
|
||||
"--feature-gates=${concatStringsSep "," (builtins.attrValues (mapAttrs (n: v: "${n}=${trivial.boolToString v}") cfg.featureGates))}"} \
|
||||
--kubeconfig=${top.lib.mkKubeConfig "kube-controller-manager" cfg.kubeconfig} \
|
||||
--leader-elect=${boolToString cfg.leaderElect} \
|
||||
${optionalString (cfg.rootCaFile!=null)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue