diff options
Diffstat (limited to 'pkgs/by-name/ky/kyverno-chainsaw/package.nix')
-rw-r--r-- | pkgs/by-name/ky/kyverno-chainsaw/package.nix | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/pkgs/by-name/ky/kyverno-chainsaw/package.nix b/pkgs/by-name/ky/kyverno-chainsaw/package.nix index bde16f3d6b33c..059997ff15bd7 100644 --- a/pkgs/by-name/ky/kyverno-chainsaw/package.nix +++ b/pkgs/by-name/ky/kyverno-chainsaw/package.nix @@ -1,27 +1,54 @@ -{ lib, buildGoModule, fetchFromGitHub }: +{ + buildGoModule, + fetchFromGitHub, + installShellFiles, + kyverno-chainsaw, + lib, + nix-update-script, + stdenv, + testers, +}: buildGoModule rec { pname = "kyverno-chainsaw"; - version = "0.2.5"; + version = "0.2.8"; src = fetchFromGitHub { owner = "kyverno"; repo = "chainsaw"; rev = "v${version}"; - hash = "sha256-XkHXjRPthWPFr1t66DGeM5rQHqQEObEO5MhveClBmxg="; + hash = "sha256-elszVinOGL4IbMNK3RTtzJPRRqs7qgqITQqj0g/wyk8="; }; - vendorHash = "sha256-/W9tLNomE5sQb4NqZ4XCrNY+w6GbKblOhd9MilqLY50="; + vendorHash = "sha256-HDmnI+WVv4cUia+IXrBdFBFnrxKMSFjKD6LUZ393sqs="; ldflags = [ - "-s" "-w" + "-s" + "-w" "-X github.com/kyverno/chainsaw/pkg/version.BuildVersion=v${version}" "-X github.com/kyverno/chainsaw/pkg/version.BuildHash=${version}" "-X github.com/kyverno/chainsaw/pkg/version.BuildTime=1970-01-01_00:00:00" ]; + nativeBuildInputs = [ installShellFiles ]; + doCheck = false; # requires running kubernetes + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + for shell in bash fish zsh; do + installShellCompletion --cmd kyverno-chainsaw \ + --$shell <($out/bin/chainsaw completion $shell) + done + ''; + + passthru.tests.version = testers.testVersion { + package = kyverno-chainsaw; + command = "chainsaw version"; + version = "v${version}"; + }; + + passthru.updateScript = nix-update-script { }; + meta = { changelog = "https://github.com/kyverno/chainsaw/releases/tag/v${version}"; description = "Declarative approach to test Kubernetes operators and controllers"; |