-
Notifications
You must be signed in to change notification settings - Fork 814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce a --ignore option to allow "sync" command to continue syncing even after a particular image sync fails #1468
Conversation
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.
Thanks for the PR!
(See #1466 (comment) , this might not be the best solution for that particular situation; let’s discuss that in there. This PR is a useful feature anyway, e.g. to make as much progress as possible on unreliable network links.)
The implementation looks good; as usual, naming is the hard part :)
P.S: This is my first time with Go. Is there any checkstyle/formatting rules that I can configure my IDE with? Everytime I did a certain change, it ended up formatting a huge part of the file where it removed certain whitespaces in various places. It's currently uses the IDE default formatter (I use GoLand from IntelliJ).
We use the language’s gofmt
with the -s
option, IIRC currently using the Go 1.17 version. I don’t know how to set that up in GoLand, maybe someone else can help. Anyway, the PR tests do a formatting check and this PR looks good as is already.
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.
LGTM, one tiny wording nit.
(Or, others, feel free to merge as is.)
…to continue syncing even after a particular image sync fails
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.
LGTM. Thanks again!
Thanks everyone for the reviews and the inputs. @mtrmac, do releases happen off the main branch? If so what versions get released off that branch? The reason I ask is to decide whether I should create a PR for the 1.4 release branch containing this change so that it becomes available to us whenever the next release happens. |
Releases happen off of the main branch. |
… and not on an extremely regular/frequent schedule, so, @jaikiran , if you need an “official” release to happen pretty soon, please speak up and we’ll tag one. |
Hello @mtrmac, this particular fix and the Makefile change that was merged some days back, both, will help us in our usage of skopeo in our product. So yes, a release will be really helpful. Thank you very much. |
Thank you very much @rhatdan and others for creating this release and all the help in reviewing the changes. I've triggered our internal build to have this release integrated into our product. |
Fixes #1466
As noted in the linked issue, in the current form, the
sync
command aborts as soon as any image tag has issue during copy. This ends up being a blocker if any one of the image tag out of hundreds (for a particular image) has some issue.As suggested in the linked issue, the commit in this PR introduces a
--ignore
option to thesync
command which allows thesync
to continue with the rest of the images/tags. When an error occurs during the image copy, that error is logged and when the sync finally finishes, such errors contribute tosync
being marked as failed.I have tested this change against our setup where we were running into this issue. With this change, when
--ignore
is used, the error is now logged and the next image tag is processed and finally when the process exits you see the failure message andsync
returns with a non-zero exit code. This is the snippet from such a run:(there are a total to 352 tags identified for this image and the 154th one is the one having the issue)
That error gets reported and the process now moves on to next:
After the rest are synced, the final log message looks like:
The exit code from that run is verified to be non-zero:
I thought of adding a test case, but it's not straightforward to trigger the error in first place (I can't yet think of a way). So I haven't added one.
P.S: This is my first time with Go. Is there any checkstyle/formatting rules that I can configure my IDE with? Everytime I did a certain change, it ended up formatting a huge part of the file where it removed certain whitespaces in various places. It's currently uses the IDE default formatter (I use GoLand from IntelliJ).