diff options
author | Nick Novitski <nick@expo.io> | 2018-05-08 14:20:11 -0700 |
---|---|---|
committer | Robin Gloster <mail@glob.in> | 2018-05-28 00:30:00 +0200 |
commit | 4e31cf18496b6ebb6adfeb20afc4573c1ec5f2b7 (patch) | |
tree | cbcc5c754e58e8c37734c6a3d733f5f6571d7690 /pkgs/applications/networking/cluster/minikube/default.nix | |
parent | d2130cd8b60603e357ed77070df4c774359f2773 (diff) |
minikube: set version of vendored kubernetes libraries
This gives a valid default version when minikube attempts to download localkube, kubeadm, and other binaries, and makes downloading and vendoring localkube as binary data unnecessary.
Diffstat (limited to 'pkgs/applications/networking/cluster/minikube/default.nix')
-rw-r--r-- | pkgs/applications/networking/cluster/minikube/default.nix | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/pkgs/applications/networking/cluster/minikube/default.nix b/pkgs/applications/networking/cluster/minikube/default.nix index da951f00a0ed0..e9dddecc1603e 100644 --- a/pkgs/applications/networking/cluster/minikube/default.nix +++ b/pkgs/applications/networking/cluster/minikube/default.nix @@ -1,22 +1,8 @@ { stdenv, buildGoPackage, fetchFromGitHub, fetchurl, go-bindata, libvirt, qemu, docker-machine-kvm, - gpgme, makeWrapper, hostPlatform, vmnet }: + gpgme, makeWrapper, hostPlatform, vmnet, python }: let binPath = stdenv.lib.optionals stdenv.isLinux [ libvirt qemu docker-machine-kvm ]; - # Normally, minikube bundles localkube in its own binary via go-bindata. Unfortunately, it needs to make that localkube - # a static linux binary, and our Linux nixpkgs go compiler doesn't seem to work when asking for a cgo binary that's static - # (presumably because we don't have some static system libraries it wants), and cross-compiling cgo on Darwin is a nightmare. - # - # Note that minikube can download (and cache) versions of localkube it needs on demand. Unfortunately, minikube's knowledge - # of where it can download versions of localkube seems to rely on a json file that doesn't get updated as often as we'd like. So - # instead, we download localkube ourselves and shove it into the minikube binary. The versions URL that minikube uses is - # currently https://storage.googleapis.com/minikube/k8s_releases.json - - localkube-version = "1.10.0"; - localkube-binary = fetchurl { - url = "https://storage.googleapis.com/minikube/k8sReleases/v${localkube-version}/localkube-linux-amd64"; - sha256 = "02lkl2g274689h07pkcwnxn04swy6aa3f2z77n421mx38bbq2kpd"; - }; in buildGoPackage rec { pname = "minikube"; name = "${pname}-${version}"; @@ -31,28 +17,24 @@ in buildGoPackage rec { sha256 = "00gj8x5p0vxwy0y0g5nnddmq049h7zxvhb73lb4gii5mghr9mkws"; }; - patches = [ - ./localkube.patch - ]; - buildInputs = [ go-bindata makeWrapper gpgme ] ++ stdenv.lib.optional hostPlatform.isDarwin vmnet; subPackages = [ "cmd/minikube" ]; preBuild = '' pushd go/src/${goPackagePath} >/dev/null - mkdir -p out - cp ${localkube-binary} out/localkube - - go-bindata -nomemcopy -o pkg/minikube/assets/assets.go -pkg assets ./out/localkube deploy/addons/... + go-bindata -nomemcopy -o pkg/minikube/assets/assets.go -pkg assets deploy/addons/... ISO_VERSION=$(grep "^ISO_VERSION" Makefile | sed "s/^.*\s//") ISO_BUCKET=$(grep "^ISO_BUCKET" Makefile | sed "s/^.*\s//") + KUBERNETES_VERSION=$(${python}/bin/python hack/get_k8s_version.py --k8s-version-only 2>&1) || true export buildFlagsArray="-ldflags=\ -X k8s.io/minikube/pkg/version.version=v${version} \ -X k8s.io/minikube/pkg/version.isoVersion=$ISO_VERSION \ - -X k8s.io/minikube/pkg/version.isoPath=$ISO_BUCKET" + -X k8s.io/minikube/pkg/version.isoPath=$ISO_BUCKET \ + -X k8s.io/minikube/vendor/k8s.io/client-go/pkg/version.gitVersion=$KUBERNETES_VERSION \ + -X k8s.io/minikube/vendor/k8s.io/kubernetes/pkg/version.gitVersion=$KUBERNETES_VERSION" popd >/dev/null ''; |