summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--nixos/modules/services/cluster/kubernetes/pki.nix2
-rw-r--r--pkgs/applications/networking/cluster/kubernetes/default.nix12
2 files changed, 11 insertions, 3 deletions
diff --git a/nixos/modules/services/cluster/kubernetes/pki.nix b/nixos/modules/services/cluster/kubernetes/pki.nix
index d9311d3e3a0..faf951d8157 100644
--- a/nixos/modules/services/cluster/kubernetes/pki.nix
+++ b/nixos/modules/services/cluster/kubernetes/pki.nix
@@ -189,7 +189,7 @@ in
         # manually paste it in place. Just symlink.
         # otherwise, create the target file, ready for users to insert the token
 
-        mkdir -p $(dirname ${certmgrAPITokenPath})
+        mkdir -p "$(dirname "${certmgrAPITokenPath}")"
         if [ -f "${cfsslAPITokenPath}" ]; then
           ln -fs "${cfsslAPITokenPath}" "${certmgrAPITokenPath}"
         else
diff --git a/pkgs/applications/networking/cluster/kubernetes/default.nix b/pkgs/applications/networking/cluster/kubernetes/default.nix
index 2a66b391ae8..ac1e0aa9117 100644
--- a/pkgs/applications/networking/cluster/kubernetes/default.nix
+++ b/pkgs/applications/networking/cluster/kubernetes/default.nix
@@ -7,6 +7,7 @@
 , makeWrapper
 , rsync
 , installShellFiles
+, nixosTests
 
 , components ? [
     "cmd/kubelet"
@@ -66,8 +67,8 @@ stdenv.mkDerivation rec {
     install -D build/pause/linux/pause -t $pause/bin
     installManPage docs/man/man1/*.[1-9]
 
-    # Unfortunately, kube-addons-main.sh only looks for the lib file in either the current working dir
-    # or in /opt. We have to patch this for now.
+    # Unfortunately, kube-addons-main.sh only looks for the lib file in either the
+    # current working dir or in /opt. We have to patch this for now.
     substitute cluster/addons/addon-manager/kube-addons-main.sh $out/bin/kube-addons \
       --subst-var out
 
@@ -95,4 +96,11 @@ stdenv.mkDerivation rec {
     maintainers = with maintainers; [ johanot offline saschagrunert ];
     platforms = platforms.unix;
   };
+
+  passthru.tests = with nixosTests.kubernetes; {
+    dns-single-node = dns.singlenode;
+    dns-multi-node = dns.multinode;
+    rbac-single-node = rbac.singlenode;
+    rbac-multi-node = rbac.multinode;
+  };
 }