From a3dde7776bd8200887e68909b637bc49451b7fed Mon Sep 17 00:00:00 2001 From: Maarten Hoogendoorn Date: Fri, 18 Aug 2017 17:06:26 +0200 Subject: [PATCH] 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 = ''