Add fixes for label selector and skipping things that don't match
This commit is contained in:
@@ -119,7 +119,14 @@ func (r *Request) Body(in interface{}) *Request {
|
||||
// Params isused to set paramters on a request
|
||||
func (r *Request) Params(p *Params) *Request {
|
||||
for k, v := range p.LabelSelector {
|
||||
r.params.Add("labelSelector", k+"="+v)
|
||||
// create new key=value pair
|
||||
value := fmt.Sprintf("%s=%s", k, v)
|
||||
// check if there's an existing value
|
||||
if label := r.params.Get("labelSelector"); len(label) > 0 {
|
||||
value = fmt.Sprintf("%s,%s", label, value)
|
||||
}
|
||||
// set and overwrite the value
|
||||
r.params.Set("labelSelector", value)
|
||||
}
|
||||
|
||||
return r
|
||||
|
Reference in New Issue
Block a user