2020-04-26 03:16:52 +00:00
|
|
|
{ stdenv, lib, buildGoPackage, fetchFromGitHub, go-bindata, installShellFiles }:
|
2016-10-09 17:25:39 +00:00
|
|
|
|
2019-07-03 11:00:27 +00:00
|
|
|
let
|
2016-10-09 17:25:39 +00:00
|
|
|
goPackagePath = "k8s.io/kops";
|
|
|
|
|
2020-08-03 08:49:15 +00:00
|
|
|
generic = { version, sha256, rev ? version, ...}@attrs:
|
|
|
|
let attrs' = builtins.removeAttrs attrs ["version" "sha256" "rev"] ; in
|
2019-07-03 11:00:27 +00:00
|
|
|
buildGoPackage {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "kops";
|
|
|
|
inherit version;
|
2019-07-03 11:00:27 +00:00
|
|
|
|
|
|
|
inherit goPackagePath;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2020-08-03 08:49:15 +00:00
|
|
|
rev = rev;
|
2019-07-03 11:00:27 +00:00
|
|
|
owner = "kubernetes";
|
|
|
|
repo = "kops";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
2020-04-26 03:16:52 +00:00
|
|
|
nativeBuildInputs = [ go-bindata installShellFiles ];
|
2020-03-18 09:23:22 +00:00
|
|
|
subPackages = [ "cmd/kops" ];
|
2019-07-03 11:00:27 +00: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 03:16:52 +00:00
|
|
|
for shell in bash zsh; do
|
2020-04-28 01:50:57 +00:00
|
|
|
$out/bin/kops completion $shell > kops.$shell
|
2020-04-26 03:16:52 +00:00
|
|
|
installShellCompletion kops.$shell
|
|
|
|
done
|
2019-07-03 11:00:27 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Easiest way to get a production Kubernetes up and running";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/kubernetes/kops";
|
2019-07-03 11:00:27 +00:00
|
|
|
license = licenses.asl20;
|
2020-03-18 09:23:22 +00:00
|
|
|
maintainers = with maintainers; [ offline zimbatm kampka ];
|
2019-07-03 11:00:27 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
} // attrs';
|
|
|
|
in rec {
|
|
|
|
|
|
|
|
mkKops = generic;
|
|
|
|
|
2020-02-27 09:59:41 +00:00
|
|
|
kops_1_16 = mkKops {
|
2020-07-06 08:35:27 +00:00
|
|
|
version = "1.16.4";
|
|
|
|
sha256 = "0qi80hzd5wc8vn3y0wsckd7pq09xcshpzvcr7rl5zd4akxb0wl3f";
|
2020-02-27 09:59:41 +00:00
|
|
|
};
|
2020-06-03 06:36:57 +00:00
|
|
|
|
|
|
|
kops_1_17 = mkKops {
|
2020-07-06 08:37:25 +00:00
|
|
|
version = "1.17.1";
|
|
|
|
sha256 = "1km6nwanmhfx8rl1wp445z9ib50jr2f86rd92vilm3q4rs9kig1h";
|
2020-06-03 06:36:57 +00:00
|
|
|
};
|
2020-08-03 08:49:15 +00:00
|
|
|
|
|
|
|
kops_1_18 = mkKops rec {
|
|
|
|
version = "1.18.0";
|
|
|
|
sha256 = "16zbjxxv08j31y7lhkqx2bnx0pc3r0vpfrlhdjs26z22p5rc4rrh";
|
|
|
|
rev = "v${version}";
|
|
|
|
};
|
2016-10-09 17:25:39 +00:00
|
|
|
}
|