k3s: use patched util-linuxMinimal (#407810)

This commit is contained in:
Jörg Thalheim
2025-05-20 08:51:57 +02:00
committed by GitHub
2 changed files with 18 additions and 4 deletions
+4 -2
View File
@@ -4,9 +4,11 @@
lib ? pkgs.lib,
}:
let
allK3s = lib.filterAttrs (n: _: lib.strings.hasPrefix "k3s_" n) pkgs;
allK3s = lib.filterAttrs (
n: _: lib.strings.hasPrefix "k3s_" n && (builtins.tryEval pkgs.${n}).success
) pkgs;
in
{
lib.recurseIntoAttrs {
airgap-images = lib.mapAttrs (
_: k3s: import ./airgap-images.nix { inherit system pkgs k3s; }
) allK3s;
@@ -41,6 +41,7 @@ lib:
ethtool,
fetchFromGitHub,
fetchgit,
fetchpatch,
fetchurl,
fetchzip,
findutils,
@@ -69,7 +70,7 @@ lib:
sqlite,
stdenv,
systemd,
util-linux,
util-linuxMinimal,
yq-go,
zstd,
}:
@@ -331,6 +332,17 @@ let
ldflags = versionldflags;
}).overrideAttrs
overrideContainerdAttrs;
# TODO (#405952): remove this patch. We had to add it to avoid a mass rebuild
# for the 25.05 release. Once the above PR is merged, switch back to plain util-linuxMinimal.
k3sUtilLinux = util-linuxMinimal.overrideAttrs (prev: {
patches =
prev.patches or [ ]
++ lib.singleton (fetchpatch {
url = "https://github.com/util-linux/util-linux/pull/3479.patch";
hash = "sha256-bJqpZiPli5Pm/XpDA445Ab5jesXrlcnaO6e4V0B3rSw=";
});
});
in
buildGoModule rec {
pname = "k3s";
@@ -377,7 +389,7 @@ buildGoModule rec {
ipset
bridge-utils
ethtool
util-linux # kubelet wants 'nsenter' from util-linux: https://github.com/kubernetes/kubernetes/issues/26093#issuecomment-705994388
k3sUtilLinux # kubelet wants 'nsenter' and 'mount' from util-linux: https://github.com/kubernetes/kubernetes/issues/26093#issuecomment-705994388
conntrack-tools
runc
bash