2019-07-03 12:00:27 +01:00
|
|
|
{ stdenv, lib, buildGoPackage, fetchFromGitHub, go-bindata }:
|
2016-10-09 18:25:39 +01:00
|
|
|
|
2019-07-03 12:00:27 +01:00
|
|
|
let
|
2016-10-09 18:25:39 +01:00
|
|
|
goPackagePath = "k8s.io/kops";
|
|
|
|
|
2019-07-03 12:00:27 +01:00
|
|
|
generic = { version, sha256, ...}@attrs:
|
|
|
|
let attrs' = builtins.removeAttrs attrs ["version" "sha256"] ; 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 {
|
|
|
|
rev = version;
|
|
|
|
owner = "kubernetes";
|
|
|
|
repo = "kops";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [go-bindata];
|
|
|
|
subPackages = ["cmd/kops"];
|
|
|
|
|
|
|
|
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 = ''
|
|
|
|
mkdir -p $bin/share/bash-completion/completions
|
|
|
|
mkdir -p $bin/share/zsh/site-functions
|
|
|
|
$bin/bin/kops completion bash > $bin/share/bash-completion/completions/kops
|
|
|
|
$bin/bin/kops completion zsh > $bin/share/zsh/site-functions/_kops
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Easiest way to get a production Kubernetes up and running";
|
|
|
|
homepage = https://github.com/kubernetes/kops;
|
|
|
|
license = licenses.asl20;
|
2019-09-25 09:57:34 +01:00
|
|
|
maintainers = with maintainers; [offline zimbatm kampka];
|
2019-07-03 12:00:27 +01:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
} // attrs';
|
|
|
|
in rec {
|
|
|
|
|
|
|
|
mkKops = generic;
|
|
|
|
|
|
|
|
kops_1_12 = mkKops {
|
2019-08-05 15:05:25 +01:00
|
|
|
version = "1.12.3";
|
|
|
|
sha256 = "0rpbaz54l5v1z7ab5kpxcb4jyakkl5ysgz1sxajqmw2d6dvf7xly";
|
2016-10-09 18:25:39 +01:00
|
|
|
};
|
2019-08-05 15:03:44 +01:00
|
|
|
|
|
|
|
kops_1_13 = mkKops {
|
2019-09-25 09:57:34 +01:00
|
|
|
version = "1.13.1";
|
|
|
|
sha256 = "0knypbrpipxplgdg6r0r6ycsj7w46virmzwn5s4sdim0y8d2ppyb";
|
2019-08-05 15:03:44 +01:00
|
|
|
};
|
2016-10-09 18:25:39 +01:00
|
|
|
}
|