Skip to content

Commit 573b582

Browse files
committed
Flatten CSI compatibility option to nixkube.node.compat
Move compat option from nixkube.node.csi.compat.enable to nixkube.node.compat, accessible as nix-csi.node.compat via the module rename. Update warning to show the correct option path for users migrating away from the deprecated nix.csi.store driver.
1 parent bb1604e commit 573b582

1 file changed

Lines changed: 11 additions & 15 deletions

File tree

kubenix/daemonset.nix

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,14 @@ in
1717
enable = (lib.mkEnableOption "cache") // {
1818
default = true;
1919
};
20-
csi = {
21-
compat = {
22-
enable = (lib.mkEnableOption "nix.csi.store CSI driver (for backwards compatibility)") // {
23-
default = true;
24-
apply =
25-
value:
26-
if value then
27-
lib.warn "nixkube: CSI compatibility driver (nix.csi.store) is enabled. This is deprecated and will be removed in a future release. Please migrate to the nixkube driver name." value
28-
else
29-
value;
30-
};
31-
};
20+
compat = (lib.mkEnableOption "nix.csi.store CSI driver (for backwards compatibility)") // {
21+
default = true;
22+
apply =
23+
value:
24+
if value then
25+
lib.warn "nix-csi.node.compat: CSI compatibility driver (nix.csi.store) is enabled. This is deprecated and will be removed in a future release. Please migrate to the nixkube driver name." value
26+
else
27+
value;
3228
};
3329
nixConfig = lib.mkOption {
3430
description = "nix.conf for CSI/mounter/DaemonSet pods";
@@ -118,7 +114,7 @@ in
118114
env = lib.mkNamedList {
119115
BUILDERS_ENABLED.value = lib.boolToString cfg.builders.enable;
120116
CACHE_ENABLED.value = lib.boolToString cfg.cache.enable;
121-
ENABLE_COMPAT_DRIVER.value = lib.boolToString cfg.node.csi.compat.enable;
117+
ENABLE_COMPAT_DRIVER.value = lib.boolToString cfg.node.compat;
122118
NRI_ENABLED.value = "true";
123119
HOME.value = "/nix/var/nix-csi/root";
124120
HOST_MOUNT_PATH.value = cfg.hostMountPath;
@@ -160,7 +156,7 @@ in
160156
};
161157
};
162158
};
163-
csi-node-driver-registrar-nix-csi = lib.mkIf cfg.node.csi.compat.enable {
159+
csi-node-driver-registrar-nix-csi = lib.mkIf cfg.node.compat {
164160
image = "registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.16.0";
165161
args = [
166162
"--v=5"
@@ -182,7 +178,7 @@ in
182178
};
183179
};
184180
};
185-
livenessprobe-nix-csi = lib.mkIf cfg.node.csi.compat.enable {
181+
livenessprobe-nix-csi = lib.mkIf cfg.node.compat {
186182
image = "registry.k8s.io/sig-storage/livenessprobe:v2.18.0";
187183
args = [
188184
"--csi-address=/csi/nix.csi.store/csi.sock"

0 commit comments

Comments
 (0)