From adf964c0deb7d991375616897cc0c20cb52b24bb Mon Sep 17 00:00:00 2001 From: Morgan Jones Date: Wed, 2 Jul 2025 23:43:29 -0700 Subject: [PATCH 1/3] kubernetes: use util-linuxMinimal instead of util-linux.withPatches This, and commits to k3s and util-linux close #409339. The util-linux.withPatches API was a temporary hack for the 25.05 release to fix Kubernetes, and is going away. While we're at it, we should use util-linuxMinimal because we do not need things such as systemd support for kubelet initialization. (cherry picked from commit 949e299d246a7e2d64402dec4c3c0a841416987a) --- nixos/modules/services/cluster/kubernetes/kubelet.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/nixos/modules/services/cluster/kubernetes/kubelet.nix b/nixos/modules/services/cluster/kubernetes/kubelet.nix index ca7b524081f63..9ab5d0baf8c7e 100644 --- a/nixos/modules/services/cluster/kubernetes/kubelet.nix +++ b/nixos/modules/services/cluster/kubernetes/kubelet.nix @@ -336,10 +336,7 @@ in [ gitMinimal openssh - # TODO (#409339): remove this patch. We had to add it to avoid a mass rebuild - # for the 25.05 release. Once the staging cycle referenced in the above PR completes, - # switch back to plain util-linux. - util-linux.withPatches + util-linuxMinimal iproute2 ethtool thin-provisioning-tools From 5c5b1d82686f29a41435bcc3096f09ef45636cfa Mon Sep 17 00:00:00 2001 From: Morgan Jones Date: Wed, 2 Jul 2025 23:43:59 -0700 Subject: [PATCH 2/3] k3s: drop util-linux.withPatches This, as well as commits to kubernetes and util-linux, close #409339. util-linux.withPatches was a temporary hack to unbreak Kubernetes for the 25.05 release. (cherry picked from commit e6886d7080bac9c1c59b03c9ae1e65030106437b) --- pkgs/applications/networking/cluster/k3s/builder.nix | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pkgs/applications/networking/cluster/k3s/builder.nix b/pkgs/applications/networking/cluster/k3s/builder.nix index e2662f9894524..6d23342c91363 100644 --- a/pkgs/applications/networking/cluster/k3s/builder.nix +++ b/pkgs/applications/networking/cluster/k3s/builder.nix @@ -332,11 +332,6 @@ let ldflags = versionldflags; }).overrideAttrs overrideContainerdAttrs; - - # TODO (#409339): remove this patch. We had to add it to avoid a mass rebuild - # for the 25.05 release. Once the staging cycle referenced in the above PR completes, - # switch back to plain util-linuxMinimal. - k3sUtilLinux = util-linuxMinimal.withPatches; in buildGoModule rec { pname = "k3s"; @@ -383,7 +378,7 @@ buildGoModule rec { ipset bridge-utils ethtool - k3sUtilLinux # kubelet wants 'nsenter' and 'mount' from util-linux: https://github.com/kubernetes/kubernetes/issues/26093#issuecomment-705994388 + util-linuxMinimal # kubelet wants 'nsenter' and 'mount' from util-linux: https://github.com/kubernetes/kubernetes/issues/26093#issuecomment-705994388 conntrack-tools runc bash From c72e4edc5f22cbfc6011b6184558ce94861f7e36 Mon Sep 17 00:00:00 2001 From: Morgan Jones Date: Wed, 2 Jul 2025 23:44:54 -0700 Subject: [PATCH 3/3] util-linux: drop withPatches Closes #409339. This API was intended to be a temporary hack to fix Kubernetes and other consumers that relied on this specific util-linux mount behavior. Now that util-linux is correctly patched, we can drop this passthru. (cherry picked from commit 91a3afac528cad2c1a6048a9bb0c2d1d31207440) --- pkgs/by-name/ut/util-linux/package.nix | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/pkgs/by-name/ut/util-linux/package.nix b/pkgs/by-name/ut/util-linux/package.nix index 702cc21ebd6a3..92b7785d53f08 100644 --- a/pkgs/by-name/ut/util-linux/package.nix +++ b/pkgs/by-name/ut/util-linux/package.nix @@ -202,18 +202,6 @@ stdenv.mkDerivation (finalPackage: rec { ''; passthru = { - # TODO (#409339): Remove this hack. We had to add it to avoid a mass rebuild - # for the 25.05 release to fix Kubernetes. Once the staging cycle referenced - # in the above PR completes, this passthru and all consumers of it should go away. - withPatches = finalPackage.overrideAttrs (prev: { - patches = lib.unique ( - prev.patches or [ ] - ++ [ - ./fix-mount-regression.patch - ] - ); - }); - updateScript = gitUpdater { # No nicer place to find latest release. url = "https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git";