Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(main): add webhook test #23

Merged
merged 3 commits into from
Oct 2, 2024
Merged

feat(main): add webhook test #23

merged 3 commits into from
Oct 2, 2024

Conversation

cuisongliu
Copy link
Owner

@cuisongliu cuisongliu commented Oct 2, 2024

This pull request introduces several changes to the AutoMQ Kubernetes custom resource definition, focusing on validation logic, default values, and test enhancements. The key changes include removing default values from the struct tags, adding validation logic, and enhancing the test suite.

Validation and Default Values:

  • Removed default values from ClusterID and Image fields in AutoMQSpec struct in api/v1beta1/automq_types.go.
  • Added validation logic to ensure required fields are set and certain fields remain immutable during updates in api/v1beta1/automq_webhook.go. [1] [2]

Test Enhancements:

  • Enhanced the test suite to include tests for default values and immutability checks in api/v1beta1/webhook_suite_test.go.

Minor Changes:

  • Added the fmt package import in api/v1beta1/automq_webhook.go.
  • Added the errors package import in api/v1beta1/webhook_suite_test.go.

Signed-off-by: cuisongliu <cuisongliu@qq.com>
Signed-off-by: cuisongliu <cuisongliu@qq.com>
Signed-off-by: cuisongliu <cuisongliu@qq.com>
@cuisongliu cuisongliu changed the title feat(main): add webhook test default feat(main): add webhook test Oct 2, 2024
@cuisongliu cuisongliu merged commit 64c9d27 into main Oct 2, 2024
4 checks passed
@cuisongliu cuisongliu deleted the webhook-test branch October 2, 2024 15:03
@github-actions github-actions bot mentioned this pull request Oct 2, 2024
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