Skip to content

Conversation

@furkatgofurov7
Copy link
Member

@furkatgofurov7 furkatgofurov7 commented Oct 27, 2025

What this PR does / why we need it:
This PR adds defensive response status checking to the runtime client to validate that extension handler responses properly have a Success status, rather than just checking they don't have a Failure status.

Currently, the runtime client checks if response.GetStatus() == ResponseStatusFailure, which means any other value (including empty string, nil, or invalid values) would be treated as success.

Example Error Messages

Before: Unknown status would be silently accepted as success

After:

  • Known failure: "failed to call extension: ExtensionHandler X got failure response ..."
  • Unknown status: "failed to call extension: ExtensionHandler X got unknown response status \"foo\""

/area runtime-sdk

Part of #12291

Check for `response.GetStatus() != Success` instead of `response.GetStatus() == Failure`
to handle unknown/invalid status values defensively. This ensures the runtime client
properly validates that responses actually have a Success status rather than just checking they're not Failure.

Signed-off-by: Furkat Gofurov <[email protected]>
@k8s-ci-robot k8s-ci-robot added area/runtime-sdk Issues or PRs related to Runtime SDK cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 27, 2025
@furkatgofurov7 furkatgofurov7 moved this to PR to be reviewed in CAPI / Turtles Oct 27, 2025
@sbueringer
Copy link
Member

Thank you very much!!

/lgtm
/approve

/test pull-cluster-api-e2e-main

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 27, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: e97f503b47822dddd1ff55c9a59c0d5f9f844ace

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbueringer

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 27, 2025
@furkatgofurov7
Copy link
Member Author

/test pull-cluster-api-test-main

@k8s-ci-robot k8s-ci-robot merged commit a0090d3 into kubernetes-sigs:main Oct 27, 2025
26 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.12 milestone Oct 27, 2025
@github-project-automation github-project-automation bot moved this from PR to be reviewed to Done in CAPI / Turtles Oct 27, 2025
@furkatgofurov7 furkatgofurov7 deleted the improve-runtimeclient-unknown-resp branch October 27, 2025 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/runtime-sdk Issues or PRs related to Runtime SDK cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants