Closed zyy17 closed 1 month ago
The pull request introduces significant modifications to the GreptimeDBCluster
struct within the defaulting.go
file, including the removal of the mergeTemplate
and mergeLogging
methods, replaced by new methods MergeTemplate
and MergeLogging
. The expect.yaml
files for the GreptimeDBCluster
resource have been simplified, removing detailed configurations in favor of minimalistic empty objects. Additionally, the GreptimeDBClusterSpec
structure has been updated to make several component specifications optional, enhancing flexibility in configuration.
File Path | Change Summary |
---|---|
apis/v1alpha1/defaulting.go |
- Added: MergeTemplate() method- Added: MergeLogging() method- Removed: mergeTemplate() method- Removed: mergeLogging() method |
apis/v1alpha1/testdata/defaulting/greptimedbcluster/test00/expect.yaml |
- Updated: logging and template fields in frontend , meta , and datanode sections to {} |
apis/v1alpha1/testdata/defaulting/greptimedbcluster/test01/expect.yaml |
- Updated: Similar changes as above |
apis/v1alpha1/testdata/defaulting/greptimedbcluster/test02/expect.yaml |
- Updated: Similar changes as above |
apis/v1alpha1/testdata/defaulting/greptimedbcluster/test03/expect.yaml |
- Updated: metadata.name field from test02 to test03 |
apis/v1alpha1/greptimedbcluster_types.go |
- Updated: Made Frontend , Meta , and Datanode fields optional with omitempty tag in GreptimeDBClusterSpec |
apis/v1alpha1/defaulting_test.go |
- Added: TestClusterMerge() method to validate merging functionality for GreptimeDBCluster |
config/crd/resources/greptime.io_greptimedbclusters.yaml |
- Updated: CRD for greptimedbclusters with new properties and restructuring of existing ones |
manifests/bundle.yaml |
- Added: Namespace, CRDs, Service Account, Roles, RoleBindings, ClusterRoleBindings, and Deployment for the GreptimeDB operator |
defaulting.go
file, specifically adding default values for port configurations in the GreptimeDBCluster
struct, which directly relates to the modifications made in the main PR regarding the MergeTemplate
and MergeLogging
methods that handle configurations for the cluster.🐇 In the fields where the clusters grow,
Merging templates, a new flow!
Logging now in a simpler way,
Empty objects come out to play.
With each change, a hop and a cheer,
A clearer path as we draw near! 🌼
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
What's changed
In the original logic, we modify
template
andlogging
ofComponentSpec
inSetDefaults()
. It's hard to distinguish whether the user sets the field ofComponentSpec
of individual components or uses thebase
config.In this PR, I move the
MergeTemplate()
andMergeLogging()
fromSetDefaults()
toReconcile()
:base
field, theComponentSpec
of components will not be updated;ComponentSpec
, the field will be updated with the CR;Summary by CodeRabbit
New Features
GreptimeDBCluster
resource, enhancing configuration management.Bug Fixes
Documentation