nixpkgs/pkgs/development/tools/kube-linter/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

45 lines
1.3 KiB
Nix
Raw Normal View History

2022-07-06 17:28:27 +00:00
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, kube-linter }:
2022-01-05 10:08:21 +00:00
buildGoModule rec {
pname = "kube-linter";
2024-02-22 17:34:48 +00:00
version = "0.6.8";
2022-01-05 10:08:21 +00:00
src = fetchFromGitHub {
owner = "stackrox";
repo = pname;
2023-04-01 16:05:37 +00:00
rev = "v${version}";
2024-02-22 17:34:48 +00:00
sha256 = "sha256-abfNzf+84BWHpvLQZKyzl7WBt7UHj2zqzKq3VCqAwwY=";
2022-01-05 10:08:21 +00:00
};
2024-02-22 17:34:48 +00:00
vendorHash = "sha256-FUkGiJ/6G9vSYtAj0v9GT4OINbO3d/OKlJ0YwhONftY=";
2022-01-05 10:08:21 +00:00
ldflags = [
"-s" "-w" "-X golang.stackrox.io/kube-linter/internal/version.version=${version}"
];
2022-07-06 17:28:27 +00:00
nativeBuildInputs = [ installShellFiles ];
2023-05-12 12:25:39 +00:00
checkFlags = [ "-skip=TestCreateContextsWithIgnorePaths" ];
2022-07-06 17:28:27 +00:00
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 {
2022-01-05 10:08:21 +00:00
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";
2023-04-01 16:05:37 +00:00
changelog = "https://github.com/stackrox/kube-linter/releases/tag/v${version}";
2022-01-05 10:08:21 +00:00
license = licenses.asl20;
2023-05-12 12:25:39 +00:00
maintainers = with maintainers; [ mtesseract stehessel Intuinewin ];
2022-07-06 17:28:27 +00:00
platforms = platforms.all;
2022-01-05 10:08:21 +00:00
};
}