blob: e4c21f5d54fa3d05f64c53ba37bb533740e0c02e (
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
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, packr, ... }:
buildGoModule rec {
pname = "kubernetes-polaris";
version = "8.0.0";
src = fetchFromGitHub {
owner = "FairwindsOps";
repo = "polaris";
rev = version;
sha256 = "sha256-JNbRXDpEO0luttI1WDApMWwPhtKLUABX+R8W/g+NAJk=";
};
vendorHash = "sha256-SwHJRw75pP1zwi9ZMfUfcXt788pURM1KSbTNQF6XVqk=";
nativeBuildInputs = [ installShellFiles ];
ldflags = [
"-s"
"-w"
"-X main.Version=${version}"
"-X main.Commit=${version}"
];
preBuild = ''
${packr}/bin/packr2 -v --ignore-imports
'';
postInstall = ''
installShellCompletion --cmd polaris \
--bash <($out/bin/polaris completion bash) \
--fish <($out/bin/polaris completion fish) \
--zsh <($out/bin/polaris completion zsh)
'';
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
$out/bin/polaris help
$out/bin/polaris version | grep 'Polaris version:${version}'
runHook postInstallCheck
'';
meta = with lib; {
description = "Validate and remediate Kubernetes resources to ensure configuration best practices are followed";
homepage = "https://www.fairwinds.com/polaris";
license = with licenses; [ asl20 ];
maintainers = with maintainers; [ longer ];
};
}
|