2022-07-13 04:16:13 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, kyverno }:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "kyverno";
|
2022-12-22 14:57:15 +00:00
|
|
|
version = "1.8.5";
|
2022-07-13 04:16:13 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "kyverno";
|
|
|
|
repo = "kyverno";
|
|
|
|
rev = "v${version}";
|
2022-12-22 14:57:15 +00:00
|
|
|
sha256 = "sha256-oEy1SNlYHDuZG2urbXEfROwzfNzdbu0Yjsq98Dw+Mws=";
|
2022-07-13 04:16:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s" "-w"
|
|
|
|
"-X github.com/kyverno/kyverno/pkg/version.BuildVersion=v${version}"
|
|
|
|
"-X github.com/kyverno/kyverno/pkg/version.BuildHash=${version}"
|
|
|
|
"-X github.com/kyverno/kyverno/pkg/version.BuildTime=1970-01-01_00:00:00"
|
|
|
|
];
|
|
|
|
|
2022-11-22 08:59:00 +00:00
|
|
|
vendorSha256 = "sha256-nqJZdMkpJEG6VFCTwGUzXcCZPshJnY2FYHDm3xMlU0g=";
|
2022-07-13 04:16:13 +00:00
|
|
|
|
|
|
|
subPackages = [ "cmd/cli/kubectl-kyverno" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
postInstall = ''
|
|
|
|
# we have no integration between krew and kubectl
|
|
|
|
# so better rename binary to kyverno and use as a standalone
|
|
|
|
mv $out/bin/kubectl-kyverno $out/bin/kyverno
|
|
|
|
installShellCompletion --cmd kyverno \
|
|
|
|
--bash <($out/bin/kyverno completion bash) \
|
|
|
|
--zsh <($out/bin/kyverno completion zsh) \
|
|
|
|
--fish <($out/bin/kyverno completion fish)
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = kyverno;
|
|
|
|
command = "kyverno version";
|
|
|
|
inherit version;
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Kubernetes Native Policy Management";
|
|
|
|
homepage = "https://kyverno.io/";
|
|
|
|
changelog = "https://github.com/kyverno/kyverno/releases/tag/v${version}";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ bryanasdev000 ];
|
|
|
|
};
|
|
|
|
}
|