Skip to content

Handle missing resource config in node version helpers - #13986

Open
j1sk1ss wants to merge 1 commit into
apache:masterfrom
j1sk1ss:fix-resource-nodes-ver-missing-conf
Open

j1sk1ss wants to merge 1 commit into
apache:masterfrom
j1sk1ss:fix-resource-nodes-ver-missing-conf

Conversation

@j1sk1ss

@j1sk1ss j1sk1ss commented Sep 24, 2026

Copy link
Copy Markdown

Description

fetch_latest_conf can return nil when the referenced resource has already been deleted. get_nodes_ver and set_nodes_ver_and_nodes used the returned value immediately, which could raise an attempt to index a nil value.

This PR adds nil guards for that case. get_nodes_ver now returns nil when the latest resource config is unavailable, and set_nodes_ver_and_nodes exits without updating nodes when the resource no longer exists.

Which issue(s) this PR fixes:

Fixes #

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

Found this with Svace static analyzer

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.

1 participant