depot/third_party/nixpkgs/pkgs/development/tools/kube-linter/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

44 lines
1.3 KiB
Nix

{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, kube-linter }:
buildGoModule rec {
pname = "kube-linter";
version = "0.6.8";
src = fetchFromGitHub {
owner = "stackrox";
repo = pname;
rev = "v${version}";
sha256 = "sha256-abfNzf+84BWHpvLQZKyzl7WBt7UHj2zqzKq3VCqAwwY=";
};
vendorHash = "sha256-FUkGiJ/6G9vSYtAj0v9GT4OINbO3d/OKlJ0YwhONftY=";
ldflags = [
"-s" "-w" "-X golang.stackrox.io/kube-linter/internal/version.version=${version}"
];
nativeBuildInputs = [ installShellFiles ];
checkFlags = [ "-skip=TestCreateContextsWithIgnorePaths" ];
postInstall = ''
installShellCompletion --cmd kube-linter \
--bash <($out/bin/kube-linter completion bash) \
--fish <($out/bin/kube-linter completion fish) \
--zsh <($out/bin/kube-linter completion zsh)
'';
passthru.tests.version = testers.testVersion {
package = kube-linter;
command = "kube-linter version";
};
meta = with lib; {
description = "Static analysis tool that checks Kubernetes YAML files and Helm charts";
homepage = "https://kubelinter.io";
changelog = "https://github.com/stackrox/kube-linter/releases/tag/v${version}";
license = licenses.asl20;
maintainers = with maintainers; [ mtesseract stehessel Intuinewin ];
platforms = platforms.all;
};
}