2021-01-25 08:26:54 +00:00
|
|
|
{ lib, buildGoPackage, fetchFromGitHub, go-bindata, installShellFiles }:
|
2019-07-03 12:00:27 +01:00
|
|
|
let
|
2016-10-09 18:25:39 +01:00
|
|
|
goPackagePath = "k8s.io/kops";
|
|
|
|
|
2020-09-10 09:47:24 +01:00
|
|
|
generic = { version, sha256, rev ? version, ... }@attrs:
|
|
|
|
let attrs' = builtins.removeAttrs attrs [ "version" "sha256" "rev" ]; in
|
|
|
|
buildGoPackage
|
|
|
|
{
|
2019-08-13 22:52:01 +01:00
|
|
|
pname = "kops";
|
|
|
|
inherit version;
|
2019-07-03 12:00:27 +01:00
|
|
|
|
|
|
|
inherit goPackagePath;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2020-08-03 09:49:15 +01:00
|
|
|
rev = rev;
|
2019-07-03 12:00:27 +01:00
|
|
|
owner = "kubernetes";
|
|
|
|
repo = "kops";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
2020-04-26 04:16:52 +01:00
|
|
|
nativeBuildInputs = [ go-bindata installShellFiles ];
|
2020-03-18 09:23:22 +00:00
|
|
|
subPackages = [ "cmd/kops" ];
|
2019-07-03 12:00:27 +01:00
|
|
|
|
|
|
|
buildFlagsArray = ''
|
|
|
|
-ldflags=
|
|
|
|
-X k8s.io/kops.Version=${version}
|
|
|
|
-X k8s.io/kops.GitVersion=${version}
|
|
|
|
'';
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
(cd go/src/k8s.io/kops
|
|
|
|
go-bindata -o upup/models/bindata.go -pkg models -prefix upup/models/ upup/models/...)
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2020-04-26 04:16:52 +01:00
|
|
|
for shell in bash zsh; do
|
2020-04-28 02:50:57 +01:00
|
|
|
$out/bin/kops completion $shell > kops.$shell
|
2020-04-26 04:16:52 +01:00
|
|
|
installShellCompletion kops.$shell
|
|
|
|
done
|
2019-07-03 12:00:27 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-07-03 12:00:27 +01:00
|
|
|
description = "Easiest way to get a production Kubernetes up and running";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/kubernetes/kops";
|
2020-09-10 09:47:24 +01:00
|
|
|
changelog = "https://github.com/kubernetes/kops/tree/master/docs/releases";
|
2019-07-03 12:00:27 +01:00
|
|
|
license = licenses.asl20;
|
2021-05-07 11:31:20 +01:00
|
|
|
maintainers = with maintainers; [ offline zimbatm diegolelis ];
|
2019-07-03 12:00:27 +01:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
} // attrs';
|
2020-09-10 09:47:24 +01:00
|
|
|
in
|
|
|
|
rec {
|
2019-07-03 12:00:27 +01:00
|
|
|
|
|
|
|
mkKops = generic;
|
|
|
|
|
2021-05-07 11:31:02 +01:00
|
|
|
kops_1_19 = mkKops rec {
|
|
|
|
version = "1.19.2";
|
|
|
|
sha256 = "15csxih1xy8myky37n5dyzp5mc31pc4bq9asaw6zz51mgw8ad5r9";
|
2020-08-03 09:49:15 +01:00
|
|
|
rev = "v${version}";
|
|
|
|
};
|
2021-05-20 01:34:09 +01:00
|
|
|
|
|
|
|
kops_1_20 = mkKops rec {
|
2021-07-06 15:15:52 +01:00
|
|
|
version = "1.20.2";
|
|
|
|
sha256 = "011ib3xkj6nn7qax8d0ns8y4jhkwwmry1qnzxklvzssaxhmzs557";
|
2021-05-20 01:34:09 +01:00
|
|
|
rev = "v${version}";
|
|
|
|
};
|
2021-07-10 20:44:00 +01:00
|
|
|
|
|
|
|
kops_1_21 = mkKops rec {
|
|
|
|
version = "1.21.0";
|
|
|
|
sha256 = "sha256-T2i3qpg3GC7yaYCGrN1V5XXrUyT+Ce9Q4aV00gQJ7gM=";
|
|
|
|
rev = "v${version}";
|
|
|
|
};
|
2016-10-09 18:25:39 +01:00
|
|
|
}
|