-
Notifications
You must be signed in to change notification settings - Fork 10
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
Insecure registry support #24
Conversation
Hi @tdhooks , thanks for putting this MR together, that's great.
For 1, a unittest would suffice. test_CLI.cpp is a good source of inspiration. For 2 and 3:
Wdyt? |
Unit tests are in. I just added an insecure registry to the test config and followed the pattern in As for integration tests, simply running What could work is exposing the container's port 5000 and pushing from the host, but I'm not sure how we'd handle that within the current test framework, because we'd need to run an image and execute the push concurrently, resolve the container network location, and keep dependent events in sync. It also may make sense to host the registry in another container alongside the test container more as part of the test's environment than the test itself. That would look like, within Of course finding or hosting a registry image that has an image pre-loaded is ideal, but I haven't been able to find one, especially not from a trusted source. Overall I favor the two-container approach if this isn't an option. |
Amazing! I suggested the "simpler" option to avoid you the trouble of dealing with yet another moving piece and the cross-container network issue, but clearly you've already seen that coming :) The way I was thinking before going that path was trying to keep the images on the host (inside the In any of the two cases, we'll need a preprocessing step for the integration tests that does the pull + tag + push to the local insecure registry of the images used in integration tests (typically alpine, ubuntu, etc.), from the docker container, ideally without leaving root-owned stuff on the host. Maybe pytest can help there with a session-level fixture or maybe easier with just an earlier bash function call. Your call! (no pun intended) Thanks for your help btw |
Integration tests are up. I was able to get the local (in container) registry set up using the cache directory without needing to write root owned files to the host. I think the separate container approach could probably be done without too much trouble using container network mode, but it probably isn't worth it for these few tests. I wasn't able to get the 'from scratch' test pipeline running, but unless the test environment is appreciably different it should work the same. Worth double checking anyway, though. |
Hi @tdhooks, thanks for all your work on this PR! From my point of view everything's there to remove the Draft status and promote this to a proper PR. I have a few observations which I'll comment directly on the code. |
I've addressed and responded to comments and left them up to you all to resolve. All tests pass on my end. |
LGTM |
Hi @tdhooks, code is looking good from my side as well. |
I have received the CLA form and will get to it soon. |
CLA returned and conflicts resolved. Should be good to go. |
I confirm reception of the CLA, and everything looking good in the code. |
Adds support for insecure registries via an
insecureRegistries
array insarus.json
. This field functions the same as theinsecure-registries
field in docker'sdaemon.json
. If the registry host for the given pull is listed in this configuration field, sarus will not use secure http by default and will not validate certificates. Security enforcement is enabled by default and will be carried out in all cases except when configured not to.This PR remains WIP until the following are resolved:
closes #23