Merge pull request #3121 from LinuxSuRen/fix/vet-errs
Fix the errors found by go vet
This commit is contained in:
@@ -67,16 +67,16 @@ func TestSyncHandler(t *testing.T) {
|
||||
}{
|
||||
{
|
||||
name: "mount pvc on deploy",
|
||||
pvc: getFakePersistentVolumeClaim("fake-pvc", "vol-12345", "fake-sc", types.UID(123)),
|
||||
pvc: getFakePersistentVolumeClaim("fake-pvc", "vol-12345", "fake-sc", types.UID(fmt.Sprintf("%d", 123))),
|
||||
sc: getFakeStorageClass("fake-sc", "fake.sc.com"),
|
||||
deploy: getFakeDeployment("fake-deploy", "234", 1,
|
||||
getFakePersistentVolumeClaim("fake-pvc", "vol-12345", "fake-sc", types.UID(123))),
|
||||
getFakePersistentVolumeClaim("fake-pvc", "vol-12345", "fake-sc", types.UID(fmt.Sprintf("%d", 123)))),
|
||||
pvcKey: "default/fake-pvc",
|
||||
hasError: false,
|
||||
},
|
||||
{
|
||||
name: "unmounted pvc",
|
||||
pvc: getFakePersistentVolumeClaim("fake-pvc", "vol-12345", "fake-sc", types.UID(123)),
|
||||
pvc: getFakePersistentVolumeClaim("fake-pvc", "vol-12345", "fake-sc", types.UID(fmt.Sprintf("%d", 123))),
|
||||
sc: getFakeStorageClass("fake-sc", "fake.sc.com"),
|
||||
pvcKey: "default/fake-pvc",
|
||||
hasError: true,
|
||||
|
||||
@@ -49,7 +49,7 @@ func (r *Registry) ImageBlob(image Image, token string) (*ImageBlob, error) {
|
||||
respBody, _ := GetRespBody(resp)
|
||||
|
||||
if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusNotFound {
|
||||
log.Error("got response: " + string(resp.StatusCode) + string(respBody))
|
||||
log.Errorf("got response: statusCode is '%d', body is '%s'\n", resp.StatusCode, respBody)
|
||||
return nil, fmt.Errorf("got image blob faild")
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ func (r *Registry) ImageManifest(image Image, token string) (*ImageManifest, err
|
||||
log.Error(statusUnauthorized)
|
||||
return nil, restful.NewError(resp.StatusCode, statusUnauthorized)
|
||||
}
|
||||
log.Error("got response: " + string(resp.StatusCode) + string(respBody))
|
||||
log.Errorf("got response: statusCode is '%d', body is '%s'\n", resp.StatusCode, respBody)
|
||||
return nil, restful.NewError(resp.StatusCode, "got image manifest failed")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user