From f8a72662cf1ca0717f1007d26a3d789f088c5c47 Mon Sep 17 00:00:00 2001 From: Maarten Hoogendoorn Date: Thu, 17 Aug 2017 16:57:43 +0200 Subject: [PATCH 1/3] openshift: 1.5.0 -> 3.6.0 - Updated from 1.5.0 to 3.6.0 (this is just the next version, but Red Hat did quite the version bump there) - Added 'v' to the version; it is used by `oc cluster up` to determine which image should be downloaded. - Added myself as a maintainer. --- .../applications/networking/cluster/openshift/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/networking/cluster/openshift/default.nix b/pkgs/applications/networking/cluster/openshift/default.nix index 6ade5bab70e8..ca4793251499 100644 --- a/pkgs/applications/networking/cluster/openshift/default.nix +++ b/pkgs/applications/networking/cluster/openshift/default.nix @@ -1,7 +1,7 @@ { stdenv, fetchFromGitHub, which, buildGoPackage }: let - version = "1.5.0"; + version = "3.6.0"; ver = stdenv.lib.elemAt (stdenv.lib.splitString "." version); versionMajor = ver 0; versionMinor = ver 1; @@ -14,7 +14,7 @@ in buildGoPackage rec { owner = "openshift"; repo = "origin"; rev = "v${version}"; - sha256 = "0qvyxcyca3888nkgvyvqcmybm95ncwxb3zvrzbg2gz8kx6g6350v"; + sha256 = "08bdqvsjl6c7dmllyz8n4akb7gyn91znvbph5cgmmk1bhskycy1r"; }; buildInputs = [ which ]; @@ -28,7 +28,7 @@ in buildGoPackage rec { cd go/src/origin-v${version}-src # Openshift build require this variables to be set # unless there is a .git folder which is not the case with fetchFromGitHub - export OS_GIT_VERSION=${version} + export OS_GIT_VERSION=v${version} export OS_GIT_MAJOR=${versionMajor} export OS_GIT_MINOR=${versionMinor} make build @@ -43,7 +43,7 @@ in buildGoPackage rec { description = "Build, deploy, and manage your applications with Docker and Kubernetes"; license = licenses.asl20; homepage = http://www.openshift.org; - maintainers = with maintainers; [offline bachp]; + maintainers = with maintainers; [offline bachp moretea]; platforms = platforms.linux; }; } From a3dde7776bd8200887e68909b637bc49451b7fed Mon Sep 17 00:00:00 2001 From: Maarten Hoogendoorn Date: Fri, 18 Aug 2017 17:06:26 +0200 Subject: [PATCH 2/3] Fix `oc cluster up` The command `oc cluster up` mainly runs code though Docker containers. However, in pkg/bootstrap/docker/host/host.go, nsenter is used to run some commands on the host. For this to work on NixOS, we need to provide the absolute path to the required programs. --- .../networking/cluster/openshift/default.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/networking/cluster/openshift/default.nix b/pkgs/applications/networking/cluster/openshift/default.nix index ca4793251499..e7e2d1763ad7 100644 --- a/pkgs/applications/networking/cluster/openshift/default.nix +++ b/pkgs/applications/networking/cluster/openshift/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, which, buildGoPackage }: +{ stdenv, fetchFromGitHub, which, buildGoPackage, utillinux, coreutils }: let version = "3.6.0"; @@ -22,6 +22,17 @@ in buildGoPackage rec { goPackagePath = null; patchPhase = '' patchShebangs ./hack + substituteInPlace pkg/bootstrap/docker/host/host.go \ + --replace 'nsenter --mount=/rootfs/proc/1/ns/mnt findmnt' \ + 'nsenter --mount=/rootfs/proc/1/ns/mnt ${utillinux}/bin/findmnt' + + substituteInPlace pkg/bootstrap/docker/host/host.go \ + --replace 'nsenter --mount=/rootfs/proc/1/ns/mnt mount' \ + 'nsenter --mount=/rootfs/proc/1/ns/mnt ${utillinux}/bin/mount' + + substituteInPlace pkg/bootstrap/docker/host/host.go \ + --replace 'nsenter --mount=/rootfs/proc/1/ns/mnt mkdir' \ + 'nsenter --mount=/rootfs/proc/1/ns/mnt ${coreutils}/bin/mount' ''; buildPhase = '' From d27f710b87f4bde3ab81bd75edd3c7dfc7550ebf Mon Sep 17 00:00:00 2001 From: Maarten Hoogendoorn Date: Sun, 10 Sep 2017 16:07:50 +0200 Subject: [PATCH 3/3] mount is in utillinux --- pkgs/applications/networking/cluster/openshift/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/networking/cluster/openshift/default.nix b/pkgs/applications/networking/cluster/openshift/default.nix index e7e2d1763ad7..fdc97733c773 100644 --- a/pkgs/applications/networking/cluster/openshift/default.nix +++ b/pkgs/applications/networking/cluster/openshift/default.nix @@ -32,7 +32,7 @@ in buildGoPackage rec { substituteInPlace pkg/bootstrap/docker/host/host.go \ --replace 'nsenter --mount=/rootfs/proc/1/ns/mnt mkdir' \ - 'nsenter --mount=/rootfs/proc/1/ns/mnt ${coreutils}/bin/mount' + 'nsenter --mount=/rootfs/proc/1/ns/mnt ${utillinux}/bin/mount' ''; buildPhase = ''