diff --git a/nixos/tests/k3s/default.nix b/nixos/tests/k3s/default.nix index 4ee3cb760b399..5240f029139fb 100644 --- a/nixos/tests/k3s/default.nix +++ b/nixos/tests/k3s/default.nix @@ -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; diff --git a/pkgs/applications/networking/cluster/k3s/builder.nix b/pkgs/applications/networking/cluster/k3s/builder.nix index fdd70a653ee55..8cbb824230f01 100644 --- a/pkgs/applications/networking/cluster/k3s/builder.nix +++ b/pkgs/applications/networking/cluster/k3s/builder.nix @@ -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/commit/7dbfe31a83f45d5aef2b508697e9511c569ffbc8.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