Skip to content
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

Merged
merged 1 commit into from
Aug 3, 2018

Conversation

thomasmckay
Copy link
Contributor

@thomasmckay thomasmckay commented May 21, 2018

@thomasmckay
Copy link
Contributor Author

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?

Copy link
Member

@ekohl ekohl left a 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.

:url: <%= @crane_url %>
:ca_cert_file: <%= @crane_ca_cert %>


Copy link
Member

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,
Copy link
Member

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.

@ehelms
Copy link
Member

ehelms commented Jun 4, 2018

@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.

@thomasmckay
Copy link
Contributor Author

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?

@ehelms
Copy link
Member

ehelms commented Jun 5, 2018

You could still make this generic to registry unless you think that will cause confusion.

@ehelms
Copy link
Member

ehelms commented Jun 5, 2018

BTW, this is what currently breaks nightly so arriving at a solution soon would be ideal.

@ekohl
Copy link
Member

ekohl commented Jun 5, 2018

I think the parameter should match the one in the config so registry_url would be best. I'm not a big fan of the generic registry though. container_registry would be better.

@ekohl
Copy link
Member

ekohl commented Jun 22, 2018

Ping?

@thomasmckay
Copy link
Contributor Author

@ekohl @ehelms - Updated PR and opened new issue to align with changes needed in katello

@thomasmckay
Copy link
Contributor Author

Updated. Pointers on tests?

@thomasmckay thomasmckay changed the title refs #22951 - add registry to katello.yaml fixes #24070 - add registry to katello.yaml Jun 26, 2018
@thomasmckay
Copy link
Contributor Author

@ekohl @ehelms
I changed the stanza to

:container_image_registry:
  :crane_url: https://foo.example.com:5000
  :crane_ca_cert_file: /etc/pki/katello/certs/katello-server-ca.crt

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?

@stbenjam
Copy link
Member

Please don't forget about puppet-katello_devel, which will need similar changes.

Copy link
Member

@ekohl ekohl left a 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.

@@ -31,6 +31,10 @@
:url: <%= @qpid_url %>
:subscriptions_queue_address: <%= @candlepin_event_queue %>

:container_image_registry:
:crane_url: <%= @crane_url %>
Copy link
Member

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).

Copy link
Contributor Author

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.

Copy link
Member

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_.

Copy link
Contributor Author

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.

Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -31,6 +31,10 @@
:url: <%= @qpid_url %>
:subscriptions_queue_address: <%= @candlepin_event_queue %>

:container_image_registry:
Copy link
Member

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.

Copy link
Contributor Author

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
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

@thomasmckay
Copy link
Contributor Author

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!

@thomasmckay
Copy link
Contributor Author

Is the following acceptable?

--- katello.yaml.example
 
  # Internal configuration for communication from server to pulp crane service.
  :container_image_registry:
    :backend_registry: crane  # must be crane
    :crane_url: https://localhost:5000
    :crane_ca_cert_file: /etc/pki/katello/certs/katello-server-ca.crt


--- puppet
    
  :container_image_registry:
    :backend_registry: crane  # must be crane
    :crane_url: <%= @crane_url %>
    :crane_ca_cert_file: <%= @crane_ca_cert %>

@ekohl
Copy link
Member

ekohl commented Jul 31, 2018

If backend_registry is not yet read by katello you can leave it out. It's just good to know where it's future proof and we don't need to change it again in a later release.

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.

@thomasmckay thomasmckay force-pushed the 22951-registry branch 2 times, most recently from a82a56e to e3739c1 Compare July 31, 2018 14:03
@thomasmckay
Copy link
Contributor Author

I don't have merge permission in this repo, if someone else could do that.

@chris1984 chris1984 merged commit 16a2588 into theforeman:master Aug 3, 2018
@chris1984
Copy link
Member

Thanks @thomasmckay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants