mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-03 14:37:44 +01:00
Improve code styles and fix after Harbor refactoring
Signed-off-by: 陈德 <chende@caicloud.io>
This commit is contained in:
parent
03d5157eaf
commit
b648084d95
@ -1139,7 +1139,7 @@ paths:
|
||||
parameters:
|
||||
- name: request
|
||||
in: body
|
||||
description: reqeust to given source image and target tag
|
||||
description: Request to give source image and target tag.
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/RetagReq'
|
||||
@ -1149,7 +1149,7 @@ paths:
|
||||
'200':
|
||||
description: Image retag successfully.
|
||||
'400':
|
||||
description: Invalid image values provided
|
||||
description: Invalid image values provided.
|
||||
'401':
|
||||
description: User has no permission to the source project or destination project.
|
||||
'404':
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 VMware, Inc. All Rights Reserved.
|
||||
// Copyright Project Harbor Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@ -38,7 +38,7 @@ type Image struct {
|
||||
func ParseImage(image string) (*Image, error) {
|
||||
repo := strings.SplitN(image, "/", 2)
|
||||
if len(repo) < 2 {
|
||||
return nil, fmt.Errorf("unable to parse image from string: %s", image)
|
||||
return nil, fmt.Errorf("Unable to parse image from string: %s", image)
|
||||
}
|
||||
i := strings.SplitN(repo[1], ":", 2)
|
||||
res := &Image{
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 VMware, Inc. All Rights Reserved.
|
||||
// Copyright Project Harbor Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@ -68,7 +68,7 @@ func TestParseImage(t *testing.T) {
|
||||
}
|
||||
} else {
|
||||
if err != nil {
|
||||
t.Errorf("expect to parse %s fail, but not", c.Input)
|
||||
t.Errorf("failed to parse image %s", c.Input)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -257,7 +257,7 @@ func ping(client *http.Client, endpoint string) (string, string, error) {
|
||||
}
|
||||
}
|
||||
|
||||
log.Warningf("schemas %v are unsupported", challenges)
|
||||
log.Warningf("Schemas %v are unsupported", challenges)
|
||||
return "", "", nil
|
||||
}
|
||||
|
||||
|
@ -491,7 +491,7 @@ func (ra *RepositoryAPI) Retag() {
|
||||
}
|
||||
|
||||
// Retag the image
|
||||
if err = uiutils.Retag(srcImage, &models.Image{
|
||||
if err = coreutils.Retag(srcImage, &models.Image{
|
||||
Project: project,
|
||||
Repo: repo,
|
||||
Tag: request.Tag,
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 VMware, Inc. All Rights Reserved.
|
||||
// Copyright Project Harbor Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
Loading…
Reference in New Issue
Block a user