2021-01-25 08:26:54 +00:00
|
|
|
{ lib, buildGoPackage, fetchFromGitHub, go-bindata, installShellFiles }:
|
2019-07-03 11:00:27 +00:00
|
|
|
let
|
2016-10-09 17:25:39 +00:00
|
|
|
goPackagePath = "k8s.io/kops";
|
|
|
|
|
2020-09-10 08:47:24 +00:00
|
|
|
generic = { version, sha256, rev ? version, ... }@attrs:
|
|
|
|
let attrs' = builtins.removeAttrs attrs [ "version" "sha256" "rev" ]; in
|
|
|
|
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
|
|
|
|
2021-08-26 03:31:57 +00:00
|
|
|
ldflags = [
|
|
|
|
"-X k8s.io/kops.Version=${version}"
|
|
|
|
"-X k8s.io/kops.GitVersion=${version}"
|
|
|
|
];
|
2019-07-03 11:00:27 +00:00
|
|
|
|
|
|
|
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
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-07-03 11:00:27 +00:00
|
|
|
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";
|
2020-09-10 08:47:24 +00:00
|
|
|
changelog = "https://github.com/kubernetes/kops/tree/master/docs/releases";
|
2019-07-03 11:00:27 +00:00
|
|
|
license = licenses.asl20;
|
2021-05-07 10:31:20 +00:00
|
|
|
maintainers = with maintainers; [ offline zimbatm diegolelis ];
|
2019-07-03 11:00:27 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
} // attrs';
|
2020-09-10 08:47:24 +00:00
|
|
|
in
|
|
|
|
rec {
|
2019-07-03 11:00:27 +00:00
|
|
|
|
|
|
|
mkKops = generic;
|
|
|
|
|
2021-05-20 00:34:09 +00:00
|
|
|
kops_1_20 = mkKops rec {
|
2021-11-22 23:47:03 +00:00
|
|
|
version = "1.20.3";
|
|
|
|
sha256 = "sha256-Yrh0wFz7MQgTDwENqQouYh3pr1gOq64Rqft5yxIiCAo=";
|
2021-05-20 00:34:09 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
};
|
2021-07-10 19:44:00 +00:00
|
|
|
|
|
|
|
kops_1_21 = mkKops rec {
|
2021-11-22 23:47:47 +00:00
|
|
|
version = "1.21.4";
|
|
|
|
sha256 = "sha256-f2xOVa3N/GH5IoI6H/QwDdKTeQoF/kEHX6lNytCZ9cs=";
|
2021-07-10 19:44:00 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
};
|
2021-11-22 23:48:24 +00:00
|
|
|
|
|
|
|
kops_1_22 = mkKops rec {
|
|
|
|
version = "1.22.2";
|
|
|
|
sha256 = "sha256-9LT4/iwlPFiz+hUHE0y8DK8T9xwL9HkrrFUXrEqKbM8=";
|
|
|
|
rev = "v${version}";
|
|
|
|
};
|
2016-10-09 17:25:39 +00:00
|
|
|
}
|