Commit 502204ad authored by Clayton Coleman's avatar Clayton Coleman

Do not set empty field or label selectors on requests

Default behavior for "" is already "everything"
parent a99bb482
......@@ -180,6 +180,9 @@ func (r *Request) SelectorParam(paramName string, s labels.Selector) *Request {
if r.err != nil {
return r
}
if s.Empty() {
return r
}
return r.setParam(paramName, s.String())
}
......
......@@ -55,7 +55,7 @@ func TestCreateLists(t *testing.T) {
}{
// Minion
{
location: "/api/" + testapi.Version() + "/minions?fields=",
location: "/api/" + testapi.Version() + "/minions",
factory: factory.createMinionLW,
},
// Assigned pod
......@@ -95,15 +95,15 @@ func TestCreateWatches(t *testing.T) {
// Minion watch
{
rv: "",
location: "/api/" + testapi.Version() + "/watch/minions?fields=&resourceVersion=",
location: "/api/" + testapi.Version() + "/watch/minions?resourceVersion=",
factory: factory.createMinionLW,
}, {
rv: "0",
location: "/api/" + testapi.Version() + "/watch/minions?fields=&resourceVersion=0",
location: "/api/" + testapi.Version() + "/watch/minions?resourceVersion=0",
factory: factory.createMinionLW,
}, {
rv: "42",
location: "/api/" + testapi.Version() + "/watch/minions?fields=&resourceVersion=42",
location: "/api/" + testapi.Version() + "/watch/minions?resourceVersion=42",
factory: factory.createMinionLW,
},
// Assigned pod watches
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment