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.
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:
ClusterID
andImage
fields inAutoMQSpec
struct inapi/v1beta1/automq_types.go
.api/v1beta1/automq_webhook.go
. [1] [2]Test Enhancements:
api/v1beta1/webhook_suite_test.go
.Minor Changes:
fmt
package import inapi/v1beta1/automq_webhook.go
.errors
package import inapi/v1beta1/webhook_suite_test.go
.