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-02-02 18:25:31 +00:00
|
|
|
version = "0.6.0";
|
2022-01-07 04:07:37 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "stackrox";
|
|
|
|
repo = pname;
|
2022-05-18 14:49:53 +00:00
|
|
|
rev = version;
|
2023-02-02 18:25:31 +00:00
|
|
|
sha256 = "sha256-/iwNyThgdXAXu1ulf68+X7nA9wE9jEqN7F5wuT5GMwk=";
|
2022-01-07 04:07:37 +00:00
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
vendorHash = "sha256-jWXR7tHYT15h7QSxinYyPaBs5utUmdeWWm+GPpfwiA4=";
|
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 ];
|
|
|
|
|
|
|
|
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";
|
2022-09-22 12:36:57 +00:00
|
|
|
changelog = "https://github.com/stackrox/kube-linter/releases/tag/${version}";
|
2022-01-07 04:07:37 +00:00
|
|
|
license = licenses.asl20;
|
2022-05-18 14:49:53 +00:00
|
|
|
maintainers = with maintainers; [ mtesseract stehessel ];
|
2022-07-14 12:49:19 +00:00
|
|
|
platforms = platforms.all;
|
2022-01-07 04:07:37 +00:00
|
|
|
};
|
|
|
|
}
|