2022-07-14 12:49:19 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, kube-linter }:
|
2022-01-07 04:07:37 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "kube-linter";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "0.6.4";
|
2022-01-07 04:07:37 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "stackrox";
|
|
|
|
repo = pname;
|
2023-04-12 12:48:02 +00:00
|
|
|
rev = "v${version}";
|
2023-05-24 13:37:59 +00:00
|
|
|
sha256 = "sha256-L0JjbjV5KwI4qas8iLp5OLkleQlD29jsYLpe3ER1l2Y=";
|
2022-01-07 04:07:37 +00:00
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
vendorHash = "sha256-1erG3TFv3DR6SLDIrmRefAPjXhgXEVYFiAsUPiI7kX4=";
|
2022-01-07 04:07:37 +00:00
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s" "-w" "-X golang.stackrox.io/kube-linter/internal/version.version=${version}"
|
|
|
|
];
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
checkFlags = [ "-skip=TestCreateContextsWithIgnorePaths" ];
|
|
|
|
|
2022-07-14 12:49:19 +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)
|
|
|
|
'';
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
2022-01-07 04:07:37 +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-12 12:48:02 +00:00
|
|
|
changelog = "https://github.com/stackrox/kube-linter/releases/tag/v${version}";
|
2022-01-07 04:07:37 +00:00
|
|
|
license = licenses.asl20;
|
2023-05-24 13:37:59 +00:00
|
|
|
maintainers = with maintainers; [ mtesseract stehessel Intuinewin ];
|
2022-07-14 12:49:19 +00:00
|
|
|
platforms = platforms.all;
|
2022-01-07 04:07:37 +00:00
|
|
|
};
|
|
|
|
}
|