未验证 提交 89de94db 编写于 作者: K KubeSphere CI Bot 提交者: GitHub

Merge pull request #3121 from LinuxSuRen/fix/vet-errs

Fix the errors found by go vet
...@@ -67,16 +67,16 @@ func TestSyncHandler(t *testing.T) { ...@@ -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) { ...@@ -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 ...@@ -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")
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册