mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-05 15:38:20 +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:
|
parameters:
|
||||||
- name: request
|
- name: request
|
||||||
in: body
|
in: body
|
||||||
description: reqeust to given source image and target tag
|
description: Request to give source image and target tag.
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/RetagReq'
|
$ref: '#/definitions/RetagReq'
|
||||||
@ -1149,7 +1149,7 @@ paths:
|
|||||||
'200':
|
'200':
|
||||||
description: Image retag successfully.
|
description: Image retag successfully.
|
||||||
'400':
|
'400':
|
||||||
description: Invalid image values provided
|
description: Invalid image values provided.
|
||||||
'401':
|
'401':
|
||||||
description: User has no permission to the source project or destination project.
|
description: User has no permission to the source project or destination project.
|
||||||
'404':
|
'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");
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
// you may not use this file except in compliance with 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) {
|
func ParseImage(image string) (*Image, error) {
|
||||||
repo := strings.SplitN(image, "/", 2)
|
repo := strings.SplitN(image, "/", 2)
|
||||||
if len(repo) < 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)
|
i := strings.SplitN(repo[1], ":", 2)
|
||||||
res := &Image{
|
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");
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
// you may not use this file except in compliance with the License.
|
// you may not use this file except in compliance with the License.
|
||||||
@ -68,7 +68,7 @@ func TestParseImage(t *testing.T) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if err != nil {
|
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
|
return "", "", nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -491,7 +491,7 @@ func (ra *RepositoryAPI) Retag() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Retag the image
|
// Retag the image
|
||||||
if err = uiutils.Retag(srcImage, &models.Image{
|
if err = coreutils.Retag(srcImage, &models.Image{
|
||||||
Project: project,
|
Project: project,
|
||||||
Repo: repo,
|
Repo: repo,
|
||||||
Tag: request.Tag,
|
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");
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
// you may not use this file except in compliance with the License.
|
// you may not use this file except in compliance with the License.
|
Loading…
Reference in New Issue
Block a user