blob: 27c1b7fd063cdd68d33f8dbac5a3cac3cf4be843 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
}:
buildGoModule rec {
pname = "kubesec";
version = "2.12.0";
src = fetchFromGitHub {
owner = "controlplaneio";
repo = pname;
rev = "v${version}";
sha256 = "sha256-0irZ3mCpXDWc/RovTK9d7AT/Gfbyt1R4WjCJFZ5RFdg=";
};
vendorSha256 = "sha256-sRIGehDuAjtpOAYYtqANua8LSzl/+WolZimMxlkG5X8=";
nativeBuildInputs = [ installShellFiles ];
ldflags = [
"-s"
"-w"
"-X github.com/controlplaneio/kubesec/v${lib.versions.major version}/cmd.version=v${version}"
];
# Tests wants to download the kubernetes schema for use with kubeval
doCheck = false;
postInstall = ''
installShellCompletion --cmd kubesec \
--bash <($out/bin/kubesec completion bash) \
--fish <($out/bin/kubesec completion fish) \
--zsh <($out/bin/kubesec completion zsh)
'';
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
$out/bin/kubesec --help
$out/bin/kubesec version | grep "${version}"
runHook postInstallCheck
'';
meta = with lib; {
description = "Security risk analysis tool for Kubernetes resources";
homepage = "https://github.com/controlplaneio/kubesec";
changelog = "https://github.com/controlplaneio/kubesec/blob/v${version}/CHANGELOG.md";
license = with licenses; [ asl20 ];
maintainers = with maintainers; [ fab jk ];
};
}
|