From 0f23e0b661d26199118f18d65cca9ab1d2f1c64d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Teo=20Klestrup=20R=C3=B6ijezon?= Date: Wed, 29 Jul 2020 11:45:08 +0200 Subject: [PATCH 1/2] istioctl: bundle charts Fixes #94163 --- .../applications/networking/cluster/istioctl/default.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/networking/cluster/istioctl/default.nix b/pkgs/applications/networking/cluster/istioctl/default.nix index 90ce1d82f49..60dc2119ac5 100644 --- a/pkgs/applications/networking/cluster/istioctl/default.nix +++ b/pkgs/applications/networking/cluster/istioctl/default.nix @@ -1,4 +1,4 @@ -{ lib, buildGoModule, fetchFromGitHub }: +{ lib, buildGoModule, fetchFromGitHub, go-bindata }: buildGoModule rec { pname = "istioctl"; @@ -12,6 +12,13 @@ buildGoModule rec { }; vendorSha256 = "15l9z2a8p46jvmkl0vvm6s196mlics0qgmpm3yq3bn6cqnybdsij"; + nativeBuildInputs = [ go-bindata ]; + + preBuild = '' + patchShebangs operator/scripts + operator/scripts/create_assets_gen.sh + ''; + subPackages = [ "istioctl/cmd/istioctl" ]; meta = with lib; { 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 2/2] 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; {