func wrapToEnterHostMountNamespace()

in gce-containers-startup/volumes/volumes.go [415:424]


func wrapToEnterHostMountNamespace(origCommandline ...string) []string {
	if *hostProcPathFlag == "" {
		return origCommandline
	}
	// Change the mount namespace to the host one. Note that we're
	// not able to access the mounted directory afterwards (without
	// yet another nsenter call).
	nsenterCommandline := []string{"nsenter", fmt.Sprintf("--mount=%s/1/ns/mnt", *hostProcPathFlag), "--"}
	return append(nsenterCommandline, origCommandline...)
}