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.
This commit is contained in:
Teo Klestrup Röijezon 2020-07-29 13:50:59 +02:00
parent 0f23e0b661
commit 76856fc333

View file

@ -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; {