Skip to content

Conversation

@GautamBytes
Copy link
Contributor

@GautamBytes GautamBytes commented Jul 10, 2025

Added unit test for pkg/internal/polymorphichelpers/attachablepodforobject.go .

Our tests successfully validated all the logic paths that don't require a live Kubernetes connection:

  • The case where the object is already a pod.
  • The error path if the REST config fails.
  • The error path if SelectorsForObject fails (e.g., for an unsupported type).

The uncovered code is the final "success path" where the function tries to:

  • Create a real Kubernetes clientset.
  • Use that clientset to find and retrieve a running pod.

This part of the code is not covered because a simple unit test cannot create a real Kubernetes client and connect to the API.

@kruise-bot kruise-bot requested review from FillZpp and furykerry July 10, 2025 11:54
@kruise-bot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign hantmac for approval by writing /assign @hantmac in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@GautamBytes
Copy link
Contributor Author

@furykerry @FillZpp just pinging for review. Thanks!

@GautamBytes
Copy link
Contributor Author

@furykerry @FillZpp just pinging for review. Thanks!

@furykerry PTAL!

@GautamBytes
Copy link
Contributor Author

@furykerry @hantmac will you merge these test pr's please!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants