Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions oci/copier.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ func Copy(ctx context.Context, src *OrasRemote, dst *OrasRemote,
for idx, layer := range layers {
b, err := json.MarshalIndent(layer, "", " ")
if err != nil {
src.log.Debug(fmt.Sprintf("ERROR marshalling json: %s", err.Error()))
src.log.Debug("failed to marshal json", "error", err.Error())
}
src.log.Debug(fmt.Sprintf("Copying layer: %s", string(b)))
src.log.Debug("Copying layer", "layer", string(b))
if err := sem.Acquire(ctx, 1); err != nil {
return err
}
Expand All @@ -52,7 +52,7 @@ func Copy(ctx context.Context, src *OrasRemote, dst *OrasRemote,
return err
}
if exists {
src.log.Debug("Layer already exists in destination, skipping")
src.log.Debug("layer already exists in destination, skipping")
b := make([]byte, layer.Size)
_, _ = progressBar.Write(b)
progressBar.Updatef("[%d/%d] layers copied", idx+1, len(layers))
Expand Down Expand Up @@ -106,8 +106,7 @@ func Copy(ctx context.Context, src *OrasRemote, dst *OrasRemote,
}

duration := time.Since(start)
src.log.Debug(fmt.Sprintf("Copied %s to %s with a concurrency of %d and took %s",
src.repo.Reference, dst.repo.Reference, concurrency, duration))
src.log.Debug("copy successful", "source", src.repo.Reference, "destination", dst.repo.Reference, "concurrency", concurrency, "duration", duration)

return nil
}
4 changes: 2 additions & 2 deletions oci/progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ func (o *OrasRemote) printLayer(desc ocispec.Descriptor, suffix string) error {
title := desc.Annotations[ocispec.AnnotationTitle]
var layerInfo string
if title != "" {
layerInfo = fmt.Sprintf("%s %s", desc.Digest.Encoded()[:12], helpers.First30last30(title))
layerInfo = fmt.Sprintf("%s %s", desc.Digest.Encoded()[:12], helpers.First30Last30(title))
} else {
layerInfo = fmt.Sprintf("%s [%s]", desc.Digest.Encoded()[:12], desc.MediaType)
}
o.log.Debug(fmt.Sprintf("%s (%s)", layerInfo, suffix))
o.log.Debug("operation successful", "layer", layerInfo, "operation", suffix)
return nil
}
Loading