summaryrefslogtreecommitdiffstats
path: root/pkgs/applications/networking/cluster/minikube
diff options
context:
space:
mode:
authorNick Novitski <nick@expo.io>2018-05-08 14:20:11 -0700
committerRobin Gloster <mail@glob.in>2018-05-28 00:30:00 +0200
commit4e31cf18496b6ebb6adfeb20afc4573c1ec5f2b7 (patch)
treecbcc5c754e58e8c37734c6a3d733f5f6571d7690 /pkgs/applications/networking/cluster/minikube
parentd2130cd8b60603e357ed77070df4c774359f2773 (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')
-rw-r--r--pkgs/applications/networking/cluster/minikube/default.nix30
-rw-r--r--pkgs/applications/networking/cluster/minikube/localkube.patch20
2 files changed, 6 insertions, 44 deletions
diff --git a/pkgs/applications/networking/cluster/minikube/default.nix b/pkgs/applications/networking/cluster/minikube/default.nix
index da951f00a0ed..e9dddecc1603 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
'';
diff --git a/pkgs/applications/networking/cluster/minikube/localkube.patch b/pkgs/applications/networking/cluster/minikube/localkube.patch
deleted file mode 100644
index 2d69cded555f..000000000000
--- a/pkgs/applications/networking/cluster/minikube/localkube.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-diff --git a/pkg/minikube/bootstrapper/localkube/localkube.go b/pkg/minikube/bootstrapper/localkube/localkube.go
-index 1c4b5000..c9f120d4 100644
---- a/pkg/minikube/bootstrapper/localkube/localkube.go
-+++ b/pkg/minikube/bootstrapper/localkube/localkube.go
-@@ -113,14 +113,9 @@ func (lk *LocalkubeBootstrapper) UpdateCluster(config bootstrapper.KubernetesCon
-
- copyableFiles := []assets.CopyableFile{}
- var localkubeFile assets.CopyableFile
-- var err error
-
- //add url/file/bundled localkube to file list
-- lCacher := localkubeCacher{config}
-- localkubeFile, err = lCacher.fetchLocalkubeFromURI()
-- if err != nil {
-- return errors.Wrap(err, "Error updating localkube from uri")
-- }
-+ localkubeFile = assets.NewBinDataAsset("out/localkube", "/usr/local/bin/", "localkube", "0777")
- copyableFiles = append(copyableFiles, localkubeFile)
-
- // user added files