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

Swift info endpoint is not always the same #185

Open
tcassaert opened this issue Mar 14, 2024 · 4 comments
Open

Swift info endpoint is not always the same #185

tcassaert opened this issue Mar 14, 2024 · 4 comments

Comments

@tcassaert
Copy link

When using Grafana Mimir with Swift (which uses an old version of this library), we encountered a problem with the /info endpoint.

At https://github.com/grafana/mimir/blob/mimir-2.11.0/vendor/github.com/ncw/swift/swift.go#L637 we see it always goes up 2 directories compared to the storageUrl.

In our case, the storageUrl is https://s3.waw3-1.cloudferro.com/swift/v1, so the /info endpoint becomes https://s3.waw3-1.cloudferro.com/info. This doesn't work for us as the /info endpoint is located at https://s3.waw3-1.cloudferro.com/swift/info.

I don't know enough about Swift to know if we have a Swift installation (not managed by us) with an unconventional /info endpoint?

A regular swift info (with the python client) seems to show the correct info, so that somehow finds the correct URL.

@ncw
Copy link
Owner

ncw commented Mar 14, 2024

Do you fancy tracing the logic of the python program to see what it does?

@ncw
Copy link
Owner

ncw commented Mar 15, 2024

According to the swift docs

https://docs.openstack.org/api-ref/object-store/

Your installation looks correct.

@tcassaert
Copy link
Author

Totally not familiar with the codebase, but a quick search led me to https://github.com/openstack/python-swiftclient/blob/master/swiftclient/client.py#L1993-L2011 which seems to be covered by unit tests at https://github.com/openstack/python-swiftclient/blob/master/test/unit/test_swiftclient.py#L2081-L2125

Does that help in any way?

@ncw
Copy link
Owner

ncw commented Mar 23, 2024

@tcassaert yes that is very useful. We could import those tests and check the info endpoint parser is correct (would probably need to factor it out into its own function first).

Do you want to have a go at that?

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

No branches or pull requests

2 participants