提交 4d199010 编写于 作者: LinuxSuRen's avatar LinuxSuRen

Fix the errors found by go vet

Signed-off-by: LinuxSuRen's avatarrick <rick@jenkins-zh.cn>
上级 e9f70905
......@@ -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")
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册