Skip to content

core: validation for missing response keys in extractIntoPtr - #3897

Merged
stephenfin merged 1 commit into
gophercloud:mainfrom
kayrus:check-no-label
Aug 7, 2026
Merged

stephenfin merged 1 commit into
gophercloud:mainfrom
kayrus:check-no-label

Conversation

@kayrus

@kayrus kayrus commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

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.

@IlanZuckerman IlanZuckerman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. One proposal for the error message though.

Comment thread results.go
@stephenfin
stephenfin added this pull request to the merge queue Aug 7, 2026
Merged via the queue into gophercloud:main with commit 80fbb2c Aug 7, 2026
70 checks passed
@kayrus
kayrus deleted the check-no-label branch August 20, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-v2 This PR will be backported to v2 edit:gophercloud This PR updates common Gophercloud code semver:patch No API change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[occm] openstack.(*LbaasV2).ensureAndUpdateOctaviaSecurityGroup encounters SIGSEGV

3 participants