-
Notifications
You must be signed in to change notification settings - Fork 48
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
fixes #24070 - add registry to katello.yaml #243
Conversation
e13c925
to
66180e1
Compare
I don't like that the server errors out if there is something in the settings conf that is unrecognized, is that purposeful? Also, will upgrades get the new stanza I've added or is there something else I need to do for that? |
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 don't like that the server errors out if there is something in the settings conf that is unrecognized, is that purposeful?
Yes, we explicitly test for the full config so we don't miss anything or there's extra stuff in there. Please add it to the test.
Also, will upgrades get the new stanza I've added or is there something else I need to do for that?
Puppet will ensure the content is there after running so there should be no difference between installs and upgrades. It just ensures the end state.
templates/katello.yaml.erb
Outdated
:url: <%= @crane_url %> | ||
:ca_cert_file: <%= @crane_ca_cert %> | ||
|
||
|
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.
Nitpick - extra line here.
@@ -15,6 +15,7 @@ | |||
String $candlepin_oauth_key = $::katello::candlepin_oauth_key, | |||
String $candlepin_oauth_secret = $::katello::candlepin_oauth_secret, | |||
Stdlib::Httpsurl $pulp_url = $::katello::pulp_url, | |||
Stdlib::Httpsurl $crane_url = $::katello::crane_url, |
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 settings file generically referes to things as a regristry but this is specific to crane which is a bit of disconnect to me.
@thomasmckay SETTINGS is just a generic hash nothing special about it hence why it errors if something is missing. You'd need to write your code to handle the case where its not present or configured which is a good model to follow. |
I thought about making it a crane section except I have plans to avoid crane completely at some point and also will add some registry-specific settings unrelated to crane. Perhaps I should change the settings themselves to reflect their related to crane. Another question, should I just be using existing settings available in katello for crane comms? Maybe they are not needed at all. @parthaa @jlsherrill - What do you think? |
You could still make this generic to registry unless you think that will cause confusion. |
BTW, this is what currently breaks nightly so arriving at a solution soon would be ideal. |
I think the parameter should match the one in the config so |
Ping? |
66180e1
to
f0f9b5c
Compare
Updated. Pointers on tests? |
f0f9b5c
to
c858cc4
Compare
@ekohl @ehelms
If you approve of the naming, let me know here and I'll open a matching PR for katello (I'll open one today and link here). In terms of commit comment, should I make the katello one say "fixes #" and this one say "refs #" or some other combination? |
Please don't forget about puppet-katello_devel, which will need similar 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.
Will this always be configured? I think it was an optional configuration.
templates/katello.yaml.erb
Outdated
@@ -31,6 +31,10 @@ | |||
:url: <%= @qpid_url %> | |||
:subscriptions_queue_address: <%= @candlepin_event_queue %> | |||
|
|||
:container_image_registry: | |||
:crane_url: <%= @crane_url %> |
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.
Why are these prefixed with crane_
? I'd expect them to be url
and ca_cert_file
(similar to others above).
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.
These are the configs that katello uses to find the crane registry. These are not configs that are exposed to the users of the registry.
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.
Well, they are exposed through this module.
Also it doesn't answer why this is pinned to crane. If this option only supports crane and not a generic registry then I'd expect that the section is named crane
. The alternative is that it's generic and any registry is supported. In both cases it doesn't make sense to me to prefix options with crane_
.
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.
This section is to config the aspects of the newly implemented registry endpoint. As part of the implementation, katello needs to call pulp's crane; that's what these two configs are for. Removing the crane prefix would then not convey what the url is meant to point at.
If preferred, I could add another entry to indicate the type of backend registry it is pointing at and then remove the crane prefix from the existing two entries. Please suggest a name for this new entry.
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 would help me to see how this section and its values are used. The PR mentioned in the opening message is merged but since then I think it has changed. Could you describe how it's used or link to the current code?
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.
Usage:
Don't expose registry if settings absent
https://github.com/Katello/katello/blob/master/app/controllers/katello/api/registry/registry_proxies_controller.rb#L410-L415
Pull objects from crane
https://github.com/Katello/katello/blob/master/app/lib/katello/resources/registry.rb#L22-L27
templates/katello.yaml.erb
Outdated
@@ -31,6 +31,10 @@ | |||
:url: <%= @qpid_url %> | |||
:subscriptions_queue_address: <%= @candlepin_event_queue %> | |||
|
|||
:container_image_registry: |
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'm thinking about container image registry vs container registry but I'm not sure which would be better.
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 prefer as is but either is fine with me. We call the resource "container image" throughout the UI now (as we've tried to downplay the term docker).
@@ -34,6 +35,7 @@ | |||
$post_sync_url = "${::foreman::foreman_url}${deployment_url}/api/v2/repositories/sync_complete?token=${post_sync_token}" | |||
$candlepin_ca_cert = $::certs::ca_cert | |||
$pulp_ca_cert = $::certs::katello_server_ca_cert | |||
$crane_ca_cert = $::certs::katello_server_ca_cert |
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.
This can probably also be a Stdlib::Absolutepath
. I also think this should be kept together with the URL setting since they're related. We should have done the same with the other settings but that can be 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.
@ekohl I don't understand what is meant to change 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.
Ignore this one, I was mistakenly thinking that it was a class parameter.
I've edited the PR description to link all the relevant PRs. If there is more to do, please let me know. Thanks for your patience! |
Is the following acceptable?
|
If I'd also keep the comment in the puppet template. That way you have a minimal diff when you apply it for the first time. |
a82a56e
to
e3739c1
Compare
e3739c1
to
d2f1be9
Compare
I don't have merge permission in this repo, if someone else could do that. |
Thanks @thomasmckay |
Relies on Katello/katello#7249
theforeman/puppet-katello_devel#168
#243
Katello/katello#7543