depot/third_party/nixpkgs/pkgs/development/tools/kube-linter/default.nix
Default email 60f07311b9 Project import generated by Copybara.
GitOrigin-RevId: f8e2ebd66d097614d51a56a755450d4ae1632df1
2024-02-06 17:22:34 -08:00

44 lines
1.3 KiB
Nix

{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, kube-linter }:
buildGoModule rec {
pname = "kube-linter";
version = "0.6.7";
src = fetchFromGitHub {
owner = "stackrox";
repo = pname;
rev = "v${version}";
sha256 = "sha256-D9QJsYaYvGjDucr0Xedg2LEqfwTxzIQBBNNFZ1m5D/U=";
};
vendorHash = "sha256-ARrMHjR/fOGS8EDMCKiEr3ubWjqDySb/AdX9jNYWOVA=";
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 = "A 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;
};
}