Skip to content

Add unit tests for DeploymentToCloneSet#149

Open
GautamBytes wants to merge 1 commit intoopenkruise:masterfrom
GautamBytes:add-cloneset-conversion-tests
Open

Add unit tests for DeploymentToCloneSet#149
GautamBytes wants to merge 1 commit intoopenkruise:masterfrom
GautamBytes:add-cloneset-conversion-tests

Conversation

@GautamBytes
Copy link
Copy Markdown
Contributor

What's in this PR?

This pull request introduces a comprehensive unit test suite for the DeploymentToCloneSet conversion function located in pkg/conversion/cloneset_convertion.go.

Key Contributions

  • Complete Coverage: Adds tests to ensure all fields in the conversion function are correctly mapped, including metadata (labels, annotations, finalizers) and spec fields (replicas, selector, template, revisionHistoryLimit, minReadySeconds).
  • Update Strategy Validation: Verifies that the updateStrategy fields (paused, maxUnavailable, maxSurge) are correctly populated from the deployment's rolling update configuration.
  • Edge Case Handling: Includes specific tests for edge cases to ensure robustness, such as:
    • Zero-value inputs (replicas: 0)
    • Nil and empty fields (e.g., nil rollingUpdate configuration)

Signed-off-by: GautamBytes <manchandanigautam@gmail.com>
@kruise-bot kruise-bot requested review from FillZpp and hantmac July 12, 2025 15:47
@kruise-bot
Copy link
Copy Markdown

[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 fillzpp for approval by writing /assign @fillzpp 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.

Details 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
Copy Markdown
Contributor Author

@furykerry @hantmac please take a look!

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