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

Enable FLATPAK_INDEX for pulp registry #363

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lfu
Copy link

@lfu lfu commented Nov 26, 2024

Add FLATPAK_INDEX=True to settings.py.

@lfu
Copy link
Author

lfu commented Nov 26, 2024

cc @sjha4

@ekohl
Copy link
Member

ekohl commented Nov 26, 2024

CI failures are relevant.

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.

Test failures are related

spec/classes/plugin_container_spec.rb Outdated Show resolved Hide resolved
Copy link
Contributor

@sjha4 sjha4 left a comment

Choose a reason for hiding this comment

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

Tested functionality and able to hit /pulpcore_registry/index/static?label:org.flatpak.ref:exists=1&tag=latest endpoint based on the updated apache config and verified that pulp is serving the flatpak_index correctly based on the pulp setting change. Test based ACK..Code LGTM.. 👍🏼
Can merge if maintainers are happy with the change.

@lfu
Copy link
Author

lfu commented Dec 9, 2024

@ekohl Does this look good?

@@ -21,6 +21,16 @@
],
'request_headers' => $pulpcore::apache::api_default_request_headers + $pulpcore::apache::api_additional_request_headers,
},
{
'provider' => 'location',
'path' => $location_prefix,
Copy link
Member

Choose a reason for hiding this comment

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

Should this replace the previous definition instead? I don't see why you would specify both. Then we can also drop the $registry_version_path variable altogether.

The one reason I could see is if you want to make it depend on FLATPAK_INDEX behavior.

Copy link
Author

Choose a reason for hiding this comment

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

I think both registries are needed here. Right? @sjha4

Copy link
Member

Choose a reason for hiding this comment

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

My reasoning is that if you have ${location_prefix} mapping to ${pulpcore::apache::api_base_url} then ${location_prefix}${registry_version_path} mapping to ${pulpcore::apache::api_base_url}${registry_version_path} is already implied.

@@ -31,7 +41,7 @@
}

pulpcore::plugin { 'container':
config => 'TOKEN_AUTH_DISABLED=True',
config => "TOKEN_AUTH_DISABLED=True\nFLATPAK_INDEX=True",
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason someone might want to set this to False? Should it be a parameter?

Copy link
Author

Choose a reason for hiding this comment

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

This setting is required by Pulp to manage Flatpak images.

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.

@evgeni or @ehelms mind giving it a look as well?

Technically I suppose this would be a major version bump.

class pulpcore::plugin::container (
String $location_prefix = '/pulpcore_registry',
String $registry_version_path = '/v2/',
Copy link
Member

Choose a reason for hiding this comment

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

What is the driver for dropping the /v2/ in the path? I think that's the only part that isn't clear.

Copy link
Member

Choose a reason for hiding this comment

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

My understanding is that flatpak needs a different path, so instead of having two locations to proxy, it was decided to proxy the whole /pulpcore_registry.

Copy link
Member

Choose a reason for hiding this comment

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

Correct. #363 (review) tells me it needs to retrieve /pulpcore_registry/index/static though the spec says there's also /pulpcore_registry/index/dynamic. Prior to #363 (comment) there were both, but that looks redundant to me.

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.

5 participants