From 1d00f6a6671ee1a2c12566646e9d5e1c459082d6 Mon Sep 17 00:00:00 2001 From: 06kellyjac Date: Thu, 19 Jun 2025 18:25:54 +0100 Subject: [PATCH] kaniko: 1.24.0 -> 1.25.0 Diff: https://github.com/chainguard-dev/kaniko/compare/v1.24.0...v1.25.0 Moved to chainguard-dev fork after original GoogleContainerTools project was archived. Use finalAttrs pattern instead of rec. Replace passthru version test with versionCheckHook. --- pkgs/by-name/ka/kaniko/package.nix | 44 +++++++++++++++++------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/pkgs/by-name/ka/kaniko/package.nix b/pkgs/by-name/ka/kaniko/package.nix index a56e73a5f064..26541d4ed24b 100644 --- a/pkgs/by-name/ka/kaniko/package.nix +++ b/pkgs/by-name/ka/kaniko/package.nix @@ -6,17 +6,18 @@ installShellFiles, testers, kaniko, + versionCheckHook, }: -buildGoModule rec { +buildGoModule (finalAttrs: { pname = "kaniko"; - version = "1.24.0"; + version = "1.25.0"; src = fetchFromGitHub { - owner = "GoogleContainerTools"; + owner = "chainguard-dev"; repo = "kaniko"; - rev = "v${version}"; - hash = "sha256-Y/sdbLcmBxUBU9io1RV/CnbuBN4I334BWUDeBoHFRm8="; + rev = "v${finalAttrs.version}"; + hash = "sha256-6WOczDWIbxFH9OLMQ+KirUEwPeiq3vFm3MdQQk9D+po="; }; vendorHash = null; @@ -24,29 +25,34 @@ buildGoModule rec { ldflags = [ "-s" "-w" - "-X github.com/GoogleContainerTools/kaniko/pkg/version.version=${version}" + "-X github.com/chainguard-dev/kaniko/pkg/version.version=${finalAttrs.version}" ]; + excludedPackages = [ "hack/release_notes" ]; + nativeBuildInputs = [ installShellFiles ]; doCheck = false; # requires docker, container-diff (unpackaged yet) - postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - for shell in bash fish zsh; do - $out/bin/executor completion $shell > executor.$shell - installShellCompletion executor.$shell - done - ''; + postInstall = + let + inherit (finalAttrs.meta) mainProgram; + in + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + for shell in bash fish zsh; do + $out/bin/${mainProgram} completion $shell > ${mainProgram}.$shell + installShellCompletion ${mainProgram}.$shell + done + ''; - passthru.tests.version = testers.testVersion { - package = kaniko; - version = version; - command = "${kaniko}/bin/executor version"; - }; + doInstallCheck = true; + nativeInstallCheckInputs = [ versionCheckHook ]; + versionCheckProgram = "${placeholder "out"}/bin/${finalAttrs.meta.mainProgram}"; + versionCheckProgramArg = "version"; meta = { description = "Tool to build container images from a Dockerfile, inside a container or Kubernetes cluster"; - homepage = "https://github.com/GoogleContainerTools/kaniko"; + homepage = "https://github.com/chainguard-dev/kaniko"; license = lib.licenses.asl20; platforms = lib.platforms.linux; maintainers = with lib.maintainers; [ @@ -55,4 +61,4 @@ buildGoModule rec { ]; mainProgram = "executor"; }; -} +})