Merge pull request #64242 from kampka/refactor_kops

kops: restructure package to maintain multiple versions in the future
This commit is contained in:
zimbatm 2019-08-05 14:41:04 +00:00 committed by GitHub
commit 8b772254e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 61 additions and 38 deletions

View file

@ -1,16 +1,20 @@
{ stdenv, buildGoPackage, fetchFromGitHub, go-bindata }:
buildGoPackage rec {
name = "kops-${version}";
version = "1.12.1";
{ stdenv, lib, buildGoPackage, fetchFromGitHub, go-bindata }:
let
goPackagePath = "k8s.io/kops";
generic = { version, sha256, ...}@attrs:
let attrs' = builtins.removeAttrs attrs ["version" "sha256"] ; in
buildGoPackage {
name = "kops-${version}";
inherit goPackagePath;
src = fetchFromGitHub {
rev = version;
owner = "kubernetes";
repo = "kops";
sha256 = "09rmgazdrmnh1lqaayzfbn0ld7mbj9whihs9ijv5gf6si9p0ml9y";
inherit sha256;
};
buildInputs = [go-bindata];
@ -41,4 +45,18 @@ buildGoPackage rec {
maintainers = with maintainers; [offline zimbatm];
platforms = platforms.unix;
};
} // attrs';
in rec {
mkKops = generic;
kops_1_12 = mkKops {
version = "1.12.3";
sha256 = "0rpbaz54l5v1z7ab5kpxcb4jyakkl5ysgz1sxajqmw2d6dvf7xly";
};
kops_1_13 = mkKops {
version = "1.13.0";
sha256 = "04kbbg3gqzwzzzq1lmnpw2gqky3pfwfk7pc0laxv2yssk9wac5k1";
};
}

View file

@ -23635,7 +23635,12 @@ in
kontemplate = callPackage ../applications/networking/cluster/kontemplate { };
kops = callPackage ../applications/networking/cluster/kops { };
inherit (callPackage ../applications/networking/cluster/kops {})
mkKops
kops_1_12
kops_1_13
;
kops = kops_1_13;
lguf-brightness = callPackage ../misc/lguf-brightness { };