client: linting: fix "invalid auth header" error
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
360d38adb1
commit
e3a7a1c6ae
|
@ -82,7 +82,7 @@ func TestImagePullWithPrivilegedFuncNoError(t *testing.T) {
|
||||||
client := &Client{
|
client := &Client{
|
||||||
client: newMockClient(func(req *http.Request) (*http.Response, error) {
|
client: newMockClient(func(req *http.Request) (*http.Response, error) {
|
||||||
if !strings.HasPrefix(req.URL.Path, expectedURL) {
|
if !strings.HasPrefix(req.URL.Path, expectedURL) {
|
||||||
return nil, fmt.Errorf("Expected URL '%s', got '%s'", expectedURL, req.URL)
|
return nil, fmt.Errorf("expected URL '%s', got '%s'", expectedURL, req.URL)
|
||||||
}
|
}
|
||||||
auth := req.Header.Get(registry.AuthHeader)
|
auth := req.Header.Get(registry.AuthHeader)
|
||||||
if auth == "NotValid" {
|
if auth == "NotValid" {
|
||||||
|
@ -92,7 +92,7 @@ func TestImagePullWithPrivilegedFuncNoError(t *testing.T) {
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
if auth != "IAmValid" {
|
if auth != "IAmValid" {
|
||||||
return nil, fmt.Errorf("Invalid auth header : expected %s, got %s", "IAmValid", auth)
|
return nil, fmt.Errorf("invalid auth header: expected %s, got %s", "IAmValid", auth)
|
||||||
}
|
}
|
||||||
query := req.URL.Query()
|
query := req.URL.Query()
|
||||||
fromImage := query.Get("fromImage")
|
fromImage := query.Get("fromImage")
|
||||||
|
|
|
@ -97,7 +97,7 @@ func TestImagePushWithPrivilegedFuncNoError(t *testing.T) {
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
if auth != "IAmValid" {
|
if auth != "IAmValid" {
|
||||||
return nil, fmt.Errorf("Invalid auth header : expected %s, got %s", "IAmValid", auth)
|
return nil, fmt.Errorf("invalid auth header: expected %s, got %s", "IAmValid", auth)
|
||||||
}
|
}
|
||||||
query := req.URL.Query()
|
query := req.URL.Query()
|
||||||
tag := query.Get("tag")
|
tag := query.Get("tag")
|
||||||
|
|
|
@ -81,7 +81,7 @@ func TestImageSearchWithPrivilegedFuncNoError(t *testing.T) {
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
if auth != "IAmValid" {
|
if auth != "IAmValid" {
|
||||||
return nil, fmt.Errorf("Invalid auth header : expected 'IAmValid', got %s", auth)
|
return nil, fmt.Errorf("invalid auth header: expected 'IAmValid', got %s", auth)
|
||||||
}
|
}
|
||||||
query := req.URL.Query()
|
query := req.URL.Query()
|
||||||
term := query.Get("term")
|
term := query.Get("term")
|
||||||
|
|
|
@ -37,7 +37,7 @@ func TestPluginPush(t *testing.T) {
|
||||||
}
|
}
|
||||||
auth := req.Header.Get(registry.AuthHeader)
|
auth := req.Header.Get(registry.AuthHeader)
|
||||||
if auth != "authtoken" {
|
if auth != "authtoken" {
|
||||||
return nil, fmt.Errorf("invalid auth header : expected 'authtoken', got %s", auth)
|
return nil, fmt.Errorf("invalid auth header: expected 'authtoken', got %s", auth)
|
||||||
}
|
}
|
||||||
return &http.Response{
|
return &http.Response{
|
||||||
StatusCode: http.StatusOK,
|
StatusCode: http.StatusOK,
|
||||||
|
|
Loading…
Reference in New Issue