-
Notifications
You must be signed in to change notification settings - Fork 100
Conversation
Total int64 `json:"total,omitempty"` | ||
Complete int64 `json:"complete,omitempty"` | ||
Error string `json:"error,omitempty"` | ||
CurrentTask string `json:"currentTask,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this field so that we can tell the user what is currently happening. This is very useful in particular for --all-tags
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I do acorn copy --all-tags <source> <dest>
and then hit cancel out (say through ctrl
+c
), does the copy continue happening in the background?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tested this to see. The copy terminates properly and does not continue in the background
@@ -189,7 +189,7 @@ func isNotInternalRepo(prefix, image string) error { | |||
} | |||
|
|||
if prefix == "" { | |||
return nil | |||
prefix = fmt.Sprintf("%s.%s", system.RegistryName, system.ImagesNamespace) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated this check so that it works with the default internal registry (registry.acorn-image-system
) if nothing else is specified.
if update.CurrentTask != "" && update.CurrentTask != currentTask { | ||
if bar != nil { | ||
bar.Add(bar.Total - bar.Current) | ||
_, _ = bar.Stop() | ||
bar = nil | ||
} | ||
currentTask = update.CurrentTask | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, we reset the progress bar if the current task has changed, since we need to start a new bar for the new task.
url := c.RESTClient.Get(). | ||
Namespace(c.Namespace). | ||
Resource("images"). | ||
Name(strings.ReplaceAll(fmt.Sprintf("%s-%s", srcImage, dstImage), "/", "+")). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name parameter here is not used server-side at all.
Signed-off-by: Grant Linville <[email protected]>
Signed-off-by: Grant Linville <[email protected]>
Signed-off-by: Grant Linville <[email protected]>
Signed-off-by: Grant Linville <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't have too much context but PR looks good to me.
Great job on the work to show progress on copy!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job with this!
Signed-off-by: Grant Linville <[email protected]>
Signed-off-by: Grant Linville <[email protected]>
for #1809
This implements the
acorn copy
(aliasacorn image copy
) command, which behaves similarly tocrane copy
. It can be used to:acorn push
)--all-tags
option)This command cannot do the following:
acorn pull
)acorn tag
)By default, this command will avoid overwriting remote tags that already exist unless
--force
is specified.I left comments on some areas of the code which should hopefully clarify things.
Checklist
This is a title (#1216)
. Here's an example