diff --git a/pkgs/applications/networking/cluster/linkerd/default.nix b/pkgs/applications/networking/cluster/linkerd/default.nix index 0dd6363d07e3..eeab5a1d02ec 100644 --- a/pkgs/applications/networking/cluster/linkerd/default.nix +++ b/pkgs/applications/networking/cluster/linkerd/default.nix @@ -1,27 +1,71 @@ -{ lib, fetchFromGitHub, buildGoModule }: +{ lib, fetchFromGitHub, buildGoModule, installShellFiles }: -buildGoModule { - pname = "linkerd-unstable"; - version = "2020-05-01"; +let generic = { channel, version, sha256, vendorSha256 }: + buildGoModule rec { + pname = "linkerd-${channel}"; + inherit version vendorSha256; - src = fetchFromGitHub { - owner = "linkerd"; - repo = "linkerd2"; - rev = "9e9f3bb1e2aeab8cf20f98f5cad159bbb6f24883"; - sha256 = "1pvj31wz1klwhcqga1m8kixdqsxwmppp9ix6r3wpp4dwfig45fm0"; + src = fetchFromGitHub { + owner = "linkerd"; + repo = "linkerd2"; + rev = "${channel}-${version}"; + inherit sha256; + }; + + subPackages = [ "cli" ]; + runVend = true; + + 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 + ''; + + buildFlagsArray = [ + "-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 + ''; + + 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; + maintainers = with maintainers; [ Gonzih bryanasdev000 superherointj ]; + }; }; - - vendorSha256 = "0vls58ld50jca5yn73kvg3lx4z83cc7skky54a90pkbj737y58pz"; - - doCheck = false; - - subPackages = [ "cli/cmd" ]; - - meta = with lib; { - description = "A service mesh for Kubernetes and beyond"; - homepage = "https://linkerd.io/"; - license = licenses.asl20; - maintainers = with maintainers; [ Gonzih ]; - broken = true; - }; -} +in + { + stable = generic { + channel = "stable"; + version = "2.10.2"; + sha256 = "sha256-dOD0S4FJ2lXE+1VZooi8tKvC8ndGEHAxmAvSqoWI/m0="; + vendorSha256 = "sha256-Qb0FZOvKL9GgncfUl538PynkYbm3V8Q6lUpApUoIp5s="; + }; + edge = generic { + channel = "edge"; + version = "21.6.2"; + sha256 = "sha256-kgdKH+cIYRg5A3+wrJJ7jcY6Xl206EwBYa37PT3xn1k"; + vendorSha256 = "sha256-QVLg1ZRsNQPM4lERVHpZLbd+I32JZ1pbGNSGIVTbseg="; + }; + } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8a4575651c45..b89703bf47dc 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -24905,7 +24905,9 @@ in fluxcd = callPackage ../applications/networking/cluster/fluxcd { }; - linkerd = callPackage ../applications/networking/cluster/linkerd { }; + linkerd_stable = (callPackage ../applications/networking/cluster/linkerd { }).stable; + linkerd_edge = (callPackage ../applications/networking/cluster/linkerd { }).edge; + linkerd = linkerd_edge; kile-wl = callPackage ../applications/misc/kile-wl { };