From 76856fc3334edfc59c3b9652b92f1dbaea3de1b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Teo=20Klestrup=20R=C3=B6ijezon?= Date: Wed, 29 Jul 2020 13:50:59 +0200 Subject: [PATCH] istioctl: bundle release metadata This is required for `istioctl version` to return the correct info, and for `istioctl install` to default to the correct Docker images. --- .../networking/cluster/istioctl/default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/applications/networking/cluster/istioctl/default.nix b/pkgs/applications/networking/cluster/istioctl/default.nix index 60dc2119ac5..e4197a50ef1 100644 --- a/pkgs/applications/networking/cluster/istioctl/default.nix +++ b/pkgs/applications/networking/cluster/istioctl/default.nix @@ -14,11 +14,22 @@ buildGoModule rec { nativeBuildInputs = [ go-bindata ]; + # Bundle charts preBuild = '' patchShebangs operator/scripts operator/scripts/create_assets_gen.sh ''; + # Bundle release metadata + buildFlagsArray = let + attrs = [ + "istio.io/pkg/version.buildVersion=${version}" + "istio.io/pkg/version.buildStatus=Nix" + "istio.io/pkg/version.buildTag=${version}" + "istio.io/pkg/version.buildHub=docker.io/istio" + ]; + in ["-ldflags=${lib.concatMapStringsSep " " (attr: "-X ${attr}") attrs}"]; + subPackages = [ "istioctl/cmd/istioctl" ]; meta = with lib; {