|
@@ -14,20 +14,8 @@ import (
|
|
)
|
|
)
|
|
|
|
|
|
// PushImage initiates a push operation on the repository named localName.
|
|
// PushImage initiates a push operation on the repository named localName.
|
|
-func (i *ImageService) PushImage(ctx context.Context, image, tag string, metaHeaders map[string][]string, authConfig *registry.AuthConfig, outStream io.Writer) error {
|
|
|
|
|
|
+func (i *ImageService) PushImage(ctx context.Context, ref reference.Named, metaHeaders map[string][]string, authConfig *registry.AuthConfig, outStream io.Writer) error {
|
|
start := time.Now()
|
|
start := time.Now()
|
|
- ref, err := reference.ParseNormalizedNamed(image)
|
|
|
|
- if err != nil {
|
|
|
|
- return err
|
|
|
|
- }
|
|
|
|
- if tag != "" {
|
|
|
|
- // Push by digest is not supported, so only tags are supported.
|
|
|
|
- ref, err = reference.WithTag(ref, tag)
|
|
|
|
- if err != nil {
|
|
|
|
- return err
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
// Include a buffer so that slow client connections don't affect
|
|
// Include a buffer so that slow client connections don't affect
|
|
// transfer performance.
|
|
// transfer performance.
|
|
progressChan := make(chan progress.Progress, 100)
|
|
progressChan := make(chan progress.Progress, 100)
|
|
@@ -57,7 +45,7 @@ func (i *ImageService) PushImage(ctx context.Context, image, tag string, metaHea
|
|
UploadManager: i.uploadManager,
|
|
UploadManager: i.uploadManager,
|
|
}
|
|
}
|
|
|
|
|
|
- err = distribution.Push(ctx, ref, imagePushConfig)
|
|
|
|
|
|
+ err := distribution.Push(ctx, ref, imagePushConfig)
|
|
close(progressChan)
|
|
close(progressChan)
|
|
<-writesDone
|
|
<-writesDone
|
|
imageActions.WithValues("push").UpdateSince(start)
|
|
imageActions.WithValues("push").UpdateSince(start)
|