Skip to content

Commit a1fb4d0

Browse files
committed
Escape selector just in case
In reviewing some of the go-client code, I noticed that label selectors were escaped. So, I am doing that here. I don't know of any issues that this catches.
1 parent 5d72207 commit a1fb4d0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

runtime/kubernetes/container.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919

2020
v1 "k8s.io/api/core/v1"
2121
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22+
"k8s.io/apimachinery/pkg/fields"
2223
"k8s.io/apimachinery/pkg/types"
2324
"k8s.io/apimachinery/pkg/util/wait"
2425
)
@@ -311,7 +312,7 @@ func (c *client) WaitContainer(ctx context.Context, ctn *pipeline.Container) err
311312
c.Logger.Tracef("waiting for container %s", ctn.ID)
312313

313314
// create label selector for watching the pod
314-
selector := fmt.Sprintf("pipeline=%s", c.Pod.ObjectMeta.Name)
315+
selector := fmt.Sprintf("pipeline=%s", fields.EscapeValue(c.Pod.ObjectMeta.Name))
315316

316317
// create options for watching the container
317318
opts := metav1.ListOptions{

0 commit comments

Comments
 (0)