1 { lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, kyverno }:
7 src = fetchFromGitHub {
11 hash = "sha256-FwVB1okxhWTzWlZljGEEH9KuSsJl9GmwnX7bn4iDx/M=";
16 "-X github.com/kyverno/kyverno/pkg/version.BuildVersion=v${version}"
17 "-X github.com/kyverno/kyverno/pkg/version.BuildHash=${version}"
18 "-X github.com/kyverno/kyverno/pkg/version.BuildTime=1970-01-01_00:00:00"
21 vendorHash = "sha256-Zv393gchMaJzdHFp6U0PDlsk+yIg2t5X3nsgK48TW5A=";
23 subPackages = [ "cmd/cli/kubectl-kyverno" ];
25 nativeBuildInputs = [ installShellFiles ];
27 # we have no integration between krew and kubectl
28 # so better rename binary to kyverno and use as a standalone
29 mv $out/bin/kubectl-kyverno $out/bin/kyverno
30 installShellCompletion --cmd kyverno \
31 --bash <($out/bin/kyverno completion bash) \
32 --zsh <($out/bin/kyverno completion zsh) \
33 --fish <($out/bin/kyverno completion fish)
36 passthru.tests.version = testers.testVersion {
38 command = "kyverno version";
39 version = "v${version}"; # needed because testVersion uses grep -Fw
43 description = "Kubernetes Native Policy Management";
44 mainProgram = "kyverno";
45 homepage = "https://kyverno.io/";
46 changelog = "https://github.com/kyverno/kyverno/releases/tag/v${version}";
47 license = licenses.asl20;
48 maintainers = with maintainers; [ bryanasdev000 ];