Skip to content

Commit

Permalink
Escape selector just in case
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cognifloyd committed Mar 14, 2022
1 parent 5d72207 commit a1fb4d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion runtime/kubernetes/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (

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

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

// create options for watching the container
opts := metav1.ListOptions{
Expand Down

0 comments on commit a1fb4d0

Please sign in to comment.