Skip to content

fix: honor OS_INTERFACE for OpenStack service endpoints - #180

Open
Dayeon Jung (Dianaland1112) wants to merge 1 commit into
vexxhost:mainfrom
Dianaland1112:fix/openstack-endpoint-interface
Open

Dayeon Jung (Dianaland1112) wants to merge 1 commit into
vexxhost:mainfrom
Dianaland1112:fix/openstack-endpoint-interface

Conversation

@Dianaland1112

Copy link
Copy Markdown

Background

Workers in isolated networks may reach Keystone and internal OpenStack API endpoints while the public service URLs are unreachable. An internal OS_AUTH_URL controls authentication, but does not select the interface for subsequent service API requests.

Cause

NewClientSet passed only OS_REGION_NAME to each service client's EndpointOpts. Gophercloud applied its public availability default, and AuthOptionsFromEnv() did not read OS_INTERFACE. As a result, passing OS_INTERFACE=internal to the container did not affect the Cinder, Nova or Neutron endpoint selection.

Changes

  • Read and validate OS_INTERFACE before OpenStack authentication.
  • Accept public, internal and admin; preserve public when unset or empty.
  • Pass the selected interface and existing region to all three service clients.
  • Document container configuration and the distinction from OS_AUTH_URL.
  • Add regression tests using a local Keystone HTTP fixture and the real Gophercloud client initialization, without new dependencies.

The change is limited to internal/openstack/client.go, internal/openstack/client_test.go and README.md.

Validation

Regression against unchanged production code reproduced the missing behavior: internal and admin selected public endpoints for all three clients, and an unsupported value returned no error.

Successful fork validation passed:

  • Six regression cases: unset, empty, public, internal, admin and invalid input.
  • Region filtering with another region listed first in the catalog.
  • Invalid-input error details and rejection before contacting Keystone.
  • Formatting checks for the changed Go files.
  • go test ./...
  • go test -race ./internal/openstack
  • go vet ./...
  • go build ./...

Validation used a Fedora 44 container with Go and libnbd development packages. The three changed file blobs match the validated versions exactly. The fork-only validation workflow is excluded from this PR.

No live VMware/OpenStack migration was performed.

Closes #179

Validate the configured interface before OpenStack authentication and apply it
to Cinder, Nova and Neutron clients while preserving the public default.
Add catalog-based regression coverage and document container configuration.

Refs vexxhost#179
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

Successfully merging this pull request may close these issues.

Support OS_INTERFACE when selecting OpenStack service endpoints

1 participant