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:
@@ -65,7 +65,7 @@ let
|
||||
// lib.optionalAttrs (cfg.tlsKeyFile != null) { tlsPrivateKeyFile = cfg.tlsKeyFile; }
|
||||
// lib.optionalAttrs (cfg.clusterDomain != "") { clusterDomain = cfg.clusterDomain; }
|
||||
// lib.optionalAttrs (cfg.clusterDns != "") { clusterDNS = [ cfg.clusterDns ] ; }
|
||||
// lib.optionalAttrs (cfg.featureGates != []) { featureGates = cfg.featureGates; }
|
||||
// lib.optionalAttrs (cfg.featureGates != {}) { featureGates = cfg.featureGates; }
|
||||
));
|
||||
|
||||
manifestPath = "kubernetes/manifests";
|
||||
@@ -185,10 +185,10 @@ in
|
||||
};
|
||||
|
||||
featureGates = mkOption {
|
||||
description = "List set of feature gates";
|
||||
description = "Attribute set of feature gate";
|
||||
default = top.featureGates;
|
||||
defaultText = literalExpression "config.${otop.featureGates}";
|
||||
type = listOf str;
|
||||
type = attrsOf bool;
|
||||
};
|
||||
|
||||
healthz = {
|
||||
|
||||
Reference in New Issue
Block a user