-
Notifications
You must be signed in to change notification settings - Fork 780
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
Add dry-run mode to copy skopeo-copy #2178
base: main
Are you sure you want to change the base?
Conversation
Dry-run functionality was merged into the sync command in containers#1608. Here, the same sort of functionality is added to the copy command as well. Signed-off-by: Ryan Egesdahl <[email protected]>
The containerized targets weren't working everywhere due to a few missing items. These are corrected so containerized tests and builds will successfully. Signed-off-by: Ryan Egesdahl <[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.
Thanks for the PR.
Why does this need to be an option? A single skopeo copy
always copies one image, so what good does this do? With skopeo sync
, it might be interesting to see which images are going to be copied, because that is dynamic and changing.
In here, just substituting skopeo copy
with echo skopeo copy
in the callers would, AFAICS, deliver broadly the same kind of information; so why have the new option?
I didn’t actually review the implementation in detail yet, but the git config --global --add
calls are a clear blocker.
@@ -127,7 +130,8 @@ help: | |||
|
|||
# Do the build and the output (skopeo) should appear in current dir | |||
binary: cmd/skopeo | |||
$(CONTAINER_RUN) make bin/skopeo $(if $(DEBUG),DEBUG=$(DEBUG)) BUILDTAGS='$(BUILDTAGS)' | |||
$(CONTAINER_RUN) bash -c \ | |||
"git config --global --add safe.directory $(CONTAINER_GOSRC) && make bin/skopeo $(if $(DEBUG),DEBUG=$(DEBUG)) BUILDTAGS='$(BUILDTAGS)'" |
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 consider a single project overwriting users’ configuration like this completely unexpected to the point of being hostile.
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.
It looks a lot worse than it is. This only happens inside a container that is built from an image the user doesn't control, so it can't overwrite their configuration. It's really only modifying root
's git config in the container's ephemeral root volume. Without the change, the git
command to grab the current commit hash fails and therefore the go build
command also fails.
Incidentally, this seems to be a problem with an ownership mismatch due to user ID mapping issues when the container is started. Either the image should be fixed or user ID mapping should be implemented. This is only a stopgap measure so the tests actually run.
It's true that Even so,
See my reply to your comment about the command. I can move the test infrastructure changes to a separate PR if you still have questions and are otherwise satisfied with what I am doing. I only needed them so I could run the tests locally on my Mac. |
Dry-run functionality was merged into the sync command in #1608. Here, the same sort of functionality is added to the copy command as well.
Also, containerized targets weren't working with docker due to a few missing items. I fixed them in a second commit so I could verify all the
make
targets passed. If you would prefer that commit in a second PR, I can do so.