Do not use service_name for endpoint selection. Fix: #2074 - #2176
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## trunk #2176 +/- ##
==========================================
+ Coverage 83.57% 83.59% +0.01%
==========================================
Files 352 352
Lines 81788 81852 +64
Branches 8765 8771 +6
==========================================
+ Hits 68353 68417 +64
Misses 10562 10562
Partials 2873 2873
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
The changelog entry includes trailing whitespace on a blank line, which can trigger style/lint failures and should be cleaned up before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates OpenStack endpoint selection to prefer service type (and region) without implicitly filtering by the driver’s default service_name, only applying a name filter when explicitly provided via ex_force_service_name (with a fallback to the default name only to resolve ambiguous matches).
Changes:
- Update
OpenStackBaseConnection.get_endpoint()to passname=Noneby default and only apply name filtering whenex_force_service_nameis set, with ambiguity-resolution fallback. - Add unit tests covering the new endpoint selection behavior (no default name filtering, explicit name filtering, ambiguity fallback, and no fallback when an explicit name is set).
- Document the behavior change in
CHANGES.rst.
File summaries
| File | Description |
|---|---|
| libcloud/test/common/test_openstack.py | Adds regression tests validating endpoint selection behavior around service name filtering and ambiguity handling. |
| libcloud/common/openstack.py | Adjusts get_endpoint() selection logic to avoid default service_name filtering, with explicit-name and ambiguity fallback handling. |
| CHANGES.rst | Notes the OpenStack service catalog endpoint selection behavior change. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Do not use service_name for endpoint selection
Description
Select service catalog endpoints by service type without filtering by the default service name. The service name is only used as a filter when explicitly provided via
ex_force_service_name.Status
Checklist (tick everything that applies)