mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 06:54:01 +00:00
Merge pull request #3181 from smarterclayton/cleanup_http_items
Minor cleanups to request - fix initialism on HTTPClientFunc
This commit is contained in:
commit
9c2cd55528
@ -80,9 +80,9 @@ func (c *Fake) ServerAPIVersions() (*api.APIVersions, error) {
|
||||
return &api.APIVersions{Versions: []string{"v1beta1", "v1beta2"}}, nil
|
||||
}
|
||||
|
||||
type HttpClientFunc func(*http.Request) (*http.Response, error)
|
||||
type HTTPClientFunc func(*http.Request) (*http.Response, error)
|
||||
|
||||
func (f HttpClientFunc) Do(req *http.Request) (*http.Response, error) {
|
||||
func (f HTTPClientFunc) Do(req *http.Request) (*http.Response, error) {
|
||||
return f(req)
|
||||
}
|
||||
|
||||
|
@ -226,6 +226,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())
|
||||
}
|
||||
|
||||
|
@ -125,7 +125,7 @@ func TestRESTHelperCreate(t *testing.T) {
|
||||
|
||||
tests := []struct {
|
||||
Resp *http.Response
|
||||
RespFunc client.HttpClientFunc
|
||||
RespFunc client.HTTPClientFunc
|
||||
HttpErr error
|
||||
Modify bool
|
||||
Object runtime.Object
|
||||
@ -299,7 +299,7 @@ func TestRESTHelperUpdate(t *testing.T) {
|
||||
|
||||
tests := []struct {
|
||||
Resp *http.Response
|
||||
RespFunc client.HttpClientFunc
|
||||
RespFunc client.HTTPClientFunc
|
||||
HttpErr error
|
||||
Overwrite bool
|
||||
Object runtime.Object
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user