From 8c2a8b65c388dbc22a4f5a26eb07cfa7c1ad6fb6 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Tue, 24 Jun 2014 09:52:43 -0700 Subject: [PATCH] Escape manifest IDs when hunting the network container. This makes it possible to have manifests with _ in the ID. I'm not sure we want to allow this, but we do for now. I hope to follow this up with a deeper change to make this a bit more robust. --- pkg/kubelet/kubelet.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go index a319927781..0fc7bc7cc6 100644 --- a/pkg/kubelet/kubelet.go +++ b/pkg/kubelet/kubelet.go @@ -620,7 +620,7 @@ func (kl *Kubelet) networkContainerExists(manifest *api.ContainerManifest) (stri return "", false, err } for _, name := range pods { - if strings.Contains(name, containerNamePrefix+"--"+networkContainerName+"--"+manifest.Id+"--") { + if strings.Contains(name, containerNamePrefix+"--"+networkContainerName+"--"+escapeDash(manifest.Id)+"--") { return name, true, nil } }