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.
This commit is contained in:
Maarten Hoogendoorn 2017-08-18 17:06:26 +02:00
parent f8a72662cf
commit a3dde7776b

View file

@ -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 = ''