From 32a83dc8402bfd44b736f1500e59116b59762371 Mon Sep 17 00:00:00 2001 From: "Bryan A. S" Date: Wed, 13 Jul 2022 01:16:13 -0300 Subject: [PATCH] kyverno: init at 1.7.0 --- .../networking/cluster/kyverno/default.nix | 49 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 51 insertions(+) create mode 100644 pkgs/applications/networking/cluster/kyverno/default.nix diff --git a/pkgs/applications/networking/cluster/kyverno/default.nix b/pkgs/applications/networking/cluster/kyverno/default.nix new file mode 100644 index 000000000000..4b5679f697b3 --- /dev/null +++ b/pkgs/applications/networking/cluster/kyverno/default.nix @@ -0,0 +1,49 @@ +{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, kyverno }: + +buildGoModule rec { + pname = "kyverno"; + version = "1.7.1"; + + src = fetchFromGitHub { + owner = "kyverno"; + repo = "kyverno"; + rev = "v${version}"; + sha256 = "sha256-MHEVGJNuZozug0l+V1bRIykOe5PGA3aU3wfBV2TH/Lo="; + }; + + 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" + ]; + + vendorSha256 = "sha256-DUe1cy6PgI5qiB9BpDJxnTlBFuy/BmyqCoxRo7Ums1I="; + + 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 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 45039c4cf52d..4fa59e56f6de 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7777,6 +7777,8 @@ with pkgs; kytea = callPackage ../tools/text/kytea { }; + kyverno = callPackage ../applications/networking/cluster/kyverno { }; + k6 = callPackage ../development/tools/k6 { }; l2md = callPackage ../tools/text/l2md { };