From 6cb87e8d69b7705e3badef42fa72509486ebd6b5 Mon Sep 17 00:00:00 2001 From: Yifan Gu Date: Tue, 24 May 2016 12:33:49 -0700 Subject: [PATCH] rkt: Remove quotes in the systemd ExecStart command. With quotes, the service doesn't start for systemd 219 with the error saying the path of the netns cannot be found. This PR fixes the bug by removing the quotes surround the netns path. --- pkg/kubelet/rkt/rkt.go | 2 +- pkg/kubelet/rkt/rkt_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/kubelet/rkt/rkt.go b/pkg/kubelet/rkt/rkt.go index 9e06ddf82a6..516391192ff 100644 --- a/pkg/kubelet/rkt/rkt.go +++ b/pkg/kubelet/rkt/rkt.go @@ -936,7 +936,7 @@ func (r *Runtime) generateRunCommand(pod *api.Pod, uuid, netnsName string) (stri // TODO: switch to 'ip netns exec' once we can depend on a new // enough version that doesn't have bugs like // https://bugzilla.redhat.com/show_bug.cgi?id=882047 - nsenterExec := []string{r.nsenterPath, "--net=\"" + netnsPathFromName(netnsName) + "\"", "--"} + nsenterExec := []string{r.nsenterPath, "--net=" + netnsPathFromName(netnsName), "--"} runPrepared = append(nsenterExec, runPrepared...) } diff --git a/pkg/kubelet/rkt/rkt_test.go b/pkg/kubelet/rkt/rkt_test.go index d9e858b901d..b6e3c02ae2d 100644 --- a/pkg/kubelet/rkt/rkt_test.go +++ b/pkg/kubelet/rkt/rkt_test.go @@ -1128,7 +1128,7 @@ func TestGenerateRunCommand(t *testing.T) { []string{}, "pod-hostname-foo", nil, - " --net=\"/var/run/netns/default\" -- /bin/rkt/rkt --insecure-options=image,ondisk --local-config=/var/rkt/local/data --dir=/var/data run-prepared --net=host --hostname=pod-hostname-foo rkt-uuid-foo", + " --net=/var/run/netns/default -- /bin/rkt/rkt --insecure-options=image,ondisk --local-config=/var/rkt/local/data --dir=/var/data run-prepared --net=host --hostname=pod-hostname-foo rkt-uuid-foo", }, // Case #2, returns no dns, with host-net. { @@ -1168,7 +1168,7 @@ func TestGenerateRunCommand(t *testing.T) { []string{"."}, "pod-hostname-foo", nil, - " --net=\"/var/run/netns/default\" -- /bin/rkt/rkt --insecure-options=image,ondisk --local-config=/var/rkt/local/data --dir=/var/data run-prepared --net=host --dns=127.0.0.1 --dns-search=. --dns-opt=ndots:5 --hostname=pod-hostname-foo rkt-uuid-foo", + " --net=/var/run/netns/default -- /bin/rkt/rkt --insecure-options=image,ondisk --local-config=/var/rkt/local/data --dir=/var/data run-prepared --net=host --dns=127.0.0.1 --dns-search=. --dns-opt=ndots:5 --hostname=pod-hostname-foo rkt-uuid-foo", }, // Case #4, returns no dns, dns searches, with host-network. {