-
Notifications
You must be signed in to change notification settings - Fork 261
The --skip-tls flag shouldn't use the http protocol
#872
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
Conversation
|
Hi @omertuc. Thanks for your PR. I'm waiting for a operator-framework member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: omertuc The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Codecov Report
@@ Coverage Diff @@
## master #872 +/- ##
==========================================
+ Coverage 52.06% 52.07% +0.01%
==========================================
Files 103 103
Lines 9063 9063
==========================================
+ Hits 4719 4720 +1
+ Misses 3439 3438 -1
Partials 905 905
Continue to review full report at Codecov.
|
When using the `operator-sdk run bundle`'s `--skip-tls` flag which is described as: > skip authentication of image registry TLS certificate when pulling a bundle image in-cluster It tries to access the image registry (given in the <bundle_image> positional argument) using HTTP rather than HTTPS. This behavior is unexpected and fails when the image registry only speaks the HTTPS protocol. This commit fixes it so that the `https` scheme is still used even when the `--skip-tls` flag is specified The commit (a16399f) which seems to have introduced this behavior doesn't mention this behavior anywhere, so I'm assuming it's unintentional and therefore a bug that needs fixing. Signed-off-by: Omer Tuchfeld <otuchfel@redhat.com>
| )), | ||
| docker.WithClient(client), | ||
| } | ||
| if insecure { |
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.
Question: Have you checked your changes still work with http endpoints?
I'm not sure what these regopts do exactly. Should we maybe still keep this but only add if if the url scheme is http?
@njhale any thoughts here?
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 have not checked that, good point. Didn't think about that.
But if I do think of it, why would someone pass --skip-tls when using HTTP in the first place? And also, how does one even use http registries? e.g. How would you tell docker to use http to communicate with quay.io/foo/bar:latest? It uses https by default. Searching online didn't lead me to a conclusive answer, prefixing with http:// i.e. http://quay.io/foo/bar:latest is illegal
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's how it's done:
https://docs.docker.com/registry/insecure/#deploy-a-plain-http-registry
Basically a config file lists all registries where docker should try to communicate with HTTPS, if it gets a bad cert, ignore any errors, if there's no HTTPS on that server at all then it fallbacks to HTTP.
Doesn't seem like you can specify the protocol in the image address itself in any way I could find
Also this of-course applies to the Docker CLI, not sure about the behavior for the docker library used here
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 agree with you here. --skip-tls and http are not related at all. I just don't know if these regopts we are removing here are needed for something specific (e.g. pipeline). We may still need to add a --use-http options or something like that. So, I'll set it to ok-to-test but I'd like @njhale (who I think originally added this) to ok.
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.
Original author is here a16399f
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.
We can't change/remove current --skip-tls functionality, but we can
- update the flag's description to relay it's current functionality
- deprecate the flag
- add new flags
--skip-tls-verifyand--use-httpto enable their respective namesake's functionality
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.
Assuming @omertuc does not update this PR soon, @dinhxuanvu @jpower432 can one of you take on the changes in a separate PR?
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.
Ah didn't realize your bullets were concrete change suggestions.
Yeah please take it on yourselves as I don't feel confident enough in this code base to make those changes
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.
Sounds good, thanks for all you've done so far!
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 can make these changes.
|
/ok-to-test |
|
This is something I'd definitely like to see fixed. Thanks for your submission @omertuc! |
|
@omertuc: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
This PR is replaced by #898 |
Description of the change:
This commit makes it so that the
httpsscheme is still used even whenthe
--skip-tlsflag is specifiedMotivation for the change:
When using the
operator-sdk run bundle's--skip-tlsflag which isdescribed as:
It tries to access the image registry (given in the <bundle_image>
positional argument) using HTTP rather than HTTPS.
This behavior is unexpected and fails when the image registry only
speaks the HTTPS protocol.
The commit (a16399f) which seems to have introduced
this behavior doesn't mention this behavior anywhere, so I'm assuming
it's unintentional and therefore a bug that needs fixing - Let me know
if you think otherwise.
Reviewer Checklist
/docs