3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/networking/cluster/linkerd/generic.nix

60 lines
1.5 KiB
Nix
Raw Normal View History

2022-01-30 11:25:33 +00:00
{ lib, fetchFromGitHub, buildGo117Module, installShellFiles }:
2021-10-01 01:40:47 +01:00
{ channel, version, sha256, vendorSha256 }:
2022-01-30 11:25:33 +00:00
# Fix-Me: Unlock buildGoModule version when #154059 is merged.
buildGo117Module rec {
2021-10-01 01:40:47 +01:00
pname = "linkerd-${channel}";
inherit version vendorSha256;
src = fetchFromGitHub {
owner = "linkerd";
repo = "linkerd2";
rev = "${channel}-${version}";
inherit sha256;
};
subPackages = [ "cli" ];
preBuild = ''
env GOFLAGS="" go generate ./pkg/charts/static
env GOFLAGS="" go generate ./jaeger/static
env GOFLAGS="" go generate ./multicluster/static
env GOFLAGS="" go generate ./viz/static
'';
tags = [
"prod"
];
ldflags = [
"-s" "-w"
"-X github.com/linkerd/linkerd2/pkg/version.Version=${src.rev}"
];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
mv $out/bin/cli $out/bin/linkerd
installShellCompletion --cmd linkerd \
--bash <($out/bin/linkerd completion bash) \
--zsh <($out/bin/linkerd completion zsh) \
--fish <($out/bin/linkerd completion fish)
'';
doInstallCheck = true;
installCheckPhase = ''
$out/bin/linkerd version --client | grep ${src.rev} > /dev/null
'';
passthru.updateScript = (./. + "/update-${channel}.sh");
meta = with lib; {
description = "A simple Kubernetes service mesh that improves security, observability and reliability";
downloadPage = "https://github.com/linkerd/linkerd2/";
homepage = "https://linkerd.io/";
license = licenses.asl20;
2021-11-03 00:38:27 +00:00
maintainers = with maintainers; [ Gonzih bryanasdev000 ];
2021-10-01 01:40:47 +01:00
};
}