Fix the errors found by go vet
Signed-off-by: rick <rick@jenkins-zh.cn>
This commit is contained in:
@@ -67,16 +67,16 @@ func TestSyncHandler(t *testing.T) {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
name: "mount pvc on deploy",
|
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"),
|
sc: getFakeStorageClass("fake-sc", "fake.sc.com"),
|
||||||
deploy: getFakeDeployment("fake-deploy", "234", 1,
|
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",
|
pvcKey: "default/fake-pvc",
|
||||||
hasError: false,
|
hasError: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "unmounted pvc",
|
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"),
|
sc: getFakeStorageClass("fake-sc", "fake.sc.com"),
|
||||||
pvcKey: "default/fake-pvc",
|
pvcKey: "default/fake-pvc",
|
||||||
hasError: true,
|
hasError: true,
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ func (r *Registry) ImageBlob(image Image, token string) (*ImageBlob, error) {
|
|||||||
respBody, _ := GetRespBody(resp)
|
respBody, _ := GetRespBody(resp)
|
||||||
|
|
||||||
if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusNotFound {
|
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")
|
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)
|
log.Error(statusUnauthorized)
|
||||||
return nil, restful.NewError(resp.StatusCode, 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")
|
return nil, restful.NewError(resp.StatusCode, "got image manifest failed")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user