diff --git a/pkg/controller/storage/expansion/expansion_controller_test.go b/pkg/controller/storage/expansion/expansion_controller_test.go index 64f1f02fbb791387b6082edf7d7e7e35dc1f7ebf..fd059e9ec48a94cf802dd86c8af43e1778764a64 100644 --- a/pkg/controller/storage/expansion/expansion_controller_test.go +++ b/pkg/controller/storage/expansion/expansion_controller_test.go @@ -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, diff --git a/pkg/models/registries/blob.go b/pkg/models/registries/blob.go index 5ca298206dbc13ab548e04acbb2002a9469a9098..083408b24a1ffc341c4a864ca7fb024a2d46ef11 100644 --- a/pkg/models/registries/blob.go +++ b/pkg/models/registries/blob.go @@ -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") } diff --git a/pkg/models/registries/manifest.go b/pkg/models/registries/manifest.go index 0facfb35e5a1a054ab431d3a18b9f39912e3c0bf..0ab036959916c9bd7d1e25456d2df80531f1c70a 100644 --- a/pkg/models/registries/manifest.go +++ b/pkg/models/registries/manifest.go @@ -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") }