Skip to content

[v2] core: validation for missing response keys in extractIntoPtr - #3916

Merged
stephenfin merged 1 commit into
v2from
bp-v2-b80f371
Aug 7, 2026
Merged

stephenfin merged 1 commit into
v2from
bp-v2-b80f371

Conversation

@gophercloud-backport-bot

Copy link
Copy Markdown

Backport: #3897

This prevents silent failures when an empty or invalid resource ID causes a wrong API endpoint to be called. The fix detects when the expected response key is missing but other data exists in the response, returning a clear error instead of allowing nil values to propagate.

The validation allows empty responses (for APIs like tokens where data is in headers) while catching all cases where the wrong endpoint was called due to invalid parameters.

Fixes: kubernetes/cloud-provider-openstack#3101

This prevents silent failures when an empty or invalid resource ID causes
a wrong API endpoint to be called. The fix detects when the expected
response key is missing but other data exists in the response, returning
a clear error instead of allowing nil values to propagate.

The validation allows empty responses (for APIs like tokens where data
is in headers) while catching all cases where the wrong endpoint was
called due to invalid parameters.
@github-actions github-actions Bot added v2 This PR targets v2 edit:gophercloud This PR updates common Gophercloud code semver:patch No API change labels Aug 7, 2026
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 63.841% (+0.006%) from 63.835% — bp-v2-b80f371 into v2

@stephenfin
stephenfin merged commit 4f3f1dc into v2 Aug 7, 2026
16 checks passed
@stephenfin
stephenfin deleted the bp-v2-b80f371 branch August 7, 2026 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

edit:gophercloud This PR updates common Gophercloud code semver:patch No API change v2 This PR targets v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants