From b85f3bd477a0ace16ea2d1f912e8ce0779206ec5 Mon Sep 17 00:00:00 2001 From: Matei Dibu Date: Tue, 30 Jun 2026 14:53:13 +0300 Subject: [PATCH] kubernetes-helmPlugins.helm-unittest: fix per-arch exec error (cherry picked from commit 1493c0a95f01099467769264d86cc058786c26bf) --- .../cluster/helm/plugins/helm-unittest.nix | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/pkgs/applications/networking/cluster/helm/plugins/helm-unittest.nix b/pkgs/applications/networking/cluster/helm/plugins/helm-unittest.nix index 48f7914cd0d5..006b9f0c9296 100644 --- a/pkgs/applications/networking/cluster/helm/plugins/helm-unittest.nix +++ b/pkgs/applications/networking/cluster/helm/plugins/helm-unittest.nix @@ -2,7 +2,6 @@ buildGoModule, fetchFromGitHub, lib, - yq-go, nix-update-script, }: @@ -22,21 +21,29 @@ buildGoModule { vendorHash = "sha256-LZOvss6wiZZi5USuXfivqtt69dTKzEmm7lM2LUDACfY="; - # NOTE: Remove the install and upgrade hooks. postPatch = '' - sed -i '/^hooks:/,+2 d' plugin.yaml + # Remove the install and upgrade hooks. + sed -i '/^platformHooks:[[:space:]]*$/,/^[^[:space:]]/d' plugin.yaml + # Remove the per-platform commands + sed -i '/^platformCommand:[[:space:]]*$/,/^[^[:space:]]/d' plugin.yaml + # Add a simple runtime config + cat <<'EOF' >> ./plugin.yaml + platformCommand: + - command: "''$HELM_PLUGIN_DIR/helm-unittest" + EOF ''; - postInstall = '' - install -dm755 $out/helm-unittest - mv $out/bin/helm-unittest $out/helm-unittest/untt - rmdir $out/bin - install -m644 -Dt $out/helm-unittest plugin.yaml - ''; + subPackages = [ "cmd/helm-unittest" ]; - nativeCheckInputs = [ - yq-go - ]; + installPhase = '' + runHook preInstall + + install -dm755 "$out/helm-unittest" + install -m755 -Dt "$out/helm-unittest" "$GOPATH/bin/helm-unittest" + install -m644 -Dt "$out/helm-unittest" ./plugin.yaml + + runHook postInstall + ''; passthru = { updateScript = nix-update-script { };