Skip to content

Commit

Permalink
Fix oc cluster up
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
moretea committed Aug 18, 2017
1 parent f8a7266 commit a3dde77
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pkgs/applications/networking/cluster/openshift/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, which, buildGoPackage }:
{ stdenv, fetchFromGitHub, which, buildGoPackage, utillinux, coreutils }:

let
version = "3.6.0";
Expand All @@ -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 = ''
Expand Down

0 comments on commit a3dde77

Please sign in to comment.