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

refactor!(api): refine the default setting of *port field of cluster #170

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

zyy17
Copy link
Collaborator

@zyy17 zyy17 commented Aug 22, 2024

What's changed

  1. Refactor SetDefaults() of GreptimeDBCluster to fix probe port setting issue

    Fix The bug with the probe's port is always 4000 even the httpSericePort is not 4000;

  2. Use livenessProbe instead of readinessProbe

    The /health in GreptimeDB is more like a liveness probe.

  3. Refine the naming of *port filed in GreptimeDBCluster and GreptimeDBStandalone;

  4. Refine the unit test structure of defaulting_test.go;

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced new configuration options for service ports (HTTP, RPC, MySQL, PostgreSQL) in GreptimeDBCluster and GreptimeDBStandalone resources.
    • Added a default health endpoint for service health checks.
  • Bug Fixes

    • Updated test cases to use the new port naming conventions, ensuring proper connectivity in testing scenarios.
  • Documentation

    • Enhanced YAML configuration files for clarity and consistency in naming conventions.
  • Chores

    • Added new dependencies for text diffing and YAML processing to improve functionality and maintainability.

Copy link
Contributor

coderabbitai bot commented Aug 22, 2024

Walkthrough

The changes include significant updates to the GreptimeDB configurations, emphasizing the renaming of service port variables for clarity, the introduction of health endpoint specifications, and enhancements to dynamic configuration for liveness probes. The testing framework has been revised to utilize YAML data files, promoting maintainability and scalability. These updates collectively streamline the codebase and refine the deployment configurations.

Changes

File Change Summary
apis/v1alpha1/defaulting.go, .../defaulting_test.go, .../greptimedbcluster_types.go, .../greptimedbstandalone_types.go Renamed service port variables for clarity, added defaultHealthEndpoint, modified probes, and updated tests to utilize YAML files for dynamic input.
apis/v1alpha1/testdata/greptimedbcluster/... Introduced new YAML configurations for GreptimeDBCluster, specifying metadata, configurations, ports, and resource management.
config/crd/resources/... Added and renamed properties in cluster and standalone resource schemas to improve clarity and standardization.
controllers/... Updated port handling and logic in various deployers (datanode, flownode, frontend, meta, standalone) to reflect changes in service port names.
go.mod Added dependencies for text diffing and YAML processing libraries.
manifests/... Enhanced configuration files for the GreptimeDB operator deployment and CRD with new properties and renamed existing ones for clarity.
tests/e2e/... Adjusted test cases to reflect changes in service port naming conventions for consistency and clarity in test setups.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant GreptimeDB  as GreptimeDB
    participant ClusterSpec as Cluster Specification
    User->>ClusterSpec: Request Deployment
    ClusterSpec->>GreptimeDB: Configure with new settings
    GreptimeDB-->>ClusterSpec: Acknowledge configuration
    ClusterSpec-->>User: Confirm deployment
Loading

🐇 In fields of green, I hop with glee,
Ports renamed, oh what a sight to see!
Health checks added, tests now more bright,
Configuration shines, oh what a delight!
With every change, our code takes flight! 🌱✨


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Inline review comments failed to post

Actionable comments posted: 4

Outside diff range, codebase verification and nitpick comments (2)
apis/v1alpha1/defaulting_test.go (2)

28-32: Ensure directory existence and handle errors gracefully.

Before attempting to read directory entries, ensure that the directory exists to avoid potential errors. Consider adding a check for directory existence and handling errors more gracefully.

if _, err := os.Stat(testDir); os.IsNotExist(err) {
	t.Fatalf("directory %s does not exist", testDir)
}

63-75: Consider using a more descriptive error message.

The error message for unexpected results could be more descriptive by including the input file name. This will help in identifying which test case failed.

t.Errorf("unexpected result for %s (input: %s):\n%s", entry.Name(), inputFile, diffmatchpatch.New().DiffPrettyText(diffmatchpatch.New().DiffMain(string(rawExpectData), string(rawInputData), false)))
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 990b7df and d03b578.

Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
Files selected for processing (26)
  • apis/v1alpha1/defaulting.go (9 hunks)
  • apis/v1alpha1/defaulting_test.go (1 hunks)
  • apis/v1alpha1/greptimedbcluster_types.go (4 hunks)
  • apis/v1alpha1/greptimedbstandalone_types.go (1 hunks)
  • apis/v1alpha1/testdata/greptimedbcluster/test00/expect.yaml (1 hunks)
  • apis/v1alpha1/testdata/greptimedbcluster/test00/input.yaml (1 hunks)
  • apis/v1alpha1/testdata/greptimedbcluster/test01/expect.yaml (1 hunks)
  • apis/v1alpha1/testdata/greptimedbcluster/test01/input.yaml (1 hunks)
  • apis/v1alpha1/testdata/greptimedbcluster/test02/expect.yaml (1 hunks)
  • apis/v1alpha1/testdata/greptimedbcluster/test02/input.yaml (1 hunks)
  • config/crd/resources/greptime.io_greptimedbclusters.yaml (7 hunks)
  • config/crd/resources/greptime.io_greptimedbstandalones.yaml (4 hunks)
  • controllers/greptimedbcluster/deployers/datanode.go (4 hunks)
  • controllers/greptimedbcluster/deployers/flownode.go (4 hunks)
  • controllers/greptimedbcluster/deployers/frontend.go (2 hunks)
  • controllers/greptimedbcluster/deployers/meta.go (2 hunks)
  • controllers/greptimedbstandalone/deployer.go (5 hunks)
  • go.mod (3 hunks)
  • manifests/greptimedb-operator-crd.yaml (11 hunks)
  • manifests/greptimedb-operator-deployment.yaml (11 hunks)
  • tests/e2e/greptimedbcluster_test.go (3 hunks)
  • tests/e2e/greptimedbstandalone_test.go (1 hunks)
  • tests/e2e/testdata/basic-cluster-with-flownode/cluster.yaml (1 hunks)
  • tests/e2e/testdata/basic-cluster/cluster.yaml (1 hunks)
  • tests/e2e/testdata/basic-standalone/standalone.yaml (1 hunks)
  • tests/e2e/testdata/cluster-with-remote-wal/cluster.yaml (1 hunks)
Files skipped from review due to trivial changes (4)
  • tests/e2e/testdata/basic-cluster-with-flownode/cluster.yaml
  • tests/e2e/testdata/basic-cluster/cluster.yaml
  • tests/e2e/testdata/basic-standalone/standalone.yaml
  • tests/e2e/testdata/cluster-with-remote-wal/cluster.yaml
Additional context used
yamllint
apis/v1alpha1/testdata/greptimedbcluster/test02/expect.yaml

[error] 62-62: no new line character at the end of file

(new-line-at-end-of-file)

Additional comments not posted (56)
apis/v1alpha1/testdata/greptimedbcluster/test00/input.yaml (1)

1-16: Configuration aligns with PR objectives.

The GreptimeDBCluster configuration specifies the httpPort, which aligns with the PR's goal of refining port settings. The setup appears consistent and clear.

apis/v1alpha1/testdata/greptimedbcluster/test02/input.yaml (1)

1-19: Configuration aligns with PR objectives.

The GreptimeDBCluster configuration includes remoteWal with Kafka broker endpoints, enhancing the cluster's functionality. This aligns with the PR's focus on clarity and functionality.

apis/v1alpha1/testdata/greptimedbcluster/test01/input.yaml (1)

1-36: Configuration aligns with PR objectives.

The GreptimeDBCluster configuration includes resource requests and limits, and uses templates for different components. This aligns with the PR's focus on improving structure and maintainability.

apis/v1alpha1/testdata/greptimedbcluster/test00/expect.yaml (1)

1-57: Configuration looks good!

The YAML configuration for GreptimeDBCluster is well-structured and includes appropriate liveness probes for health checks.

apis/v1alpha1/testdata/greptimedbcluster/test01/expect.yaml (1)

1-93: Configuration looks good!

The YAML configuration for GreptimeDBCluster is comprehensive, including resource management and liveness probes for health checks.

tests/e2e/greptimedbstandalone_test.go (1)

61-61: Verify the impact of the field name change.

Ensure that all references to MySQLServicePort have been updated to MySQLPort throughout the codebase to prevent any inconsistencies or runtime errors.

Run the following script to verify the field name change:

Verification successful

Field Name Change Verified Successfully

The field name change from MySQLServicePort to MySQLPort has been implemented consistently across the codebase. No occurrences of the old field name were found, and the new field name is used in relevant files.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all occurrences of `MySQLServicePort` have been updated to `MySQLPort`.

# Test: Search for the old field name. Expect: No occurrences of `MySQLServicePort`.
rg --type go 'MySQLServicePort'

Length of output: 31


Script:

#!/bin/bash
# Description: Verify that `MySQLPort` is used in the codebase.

# Test: Search for occurrences of `MySQLPort`.
rg --type go 'MySQLPort'

Length of output: 1883

go.mod (3)

12-12: Dependency addition: github.com/sergi/go-diff.

The addition of go-diff is appropriate for text diffing functionalities. Ensure that this library is used effectively in the codebase.


24-24: Dependency addition: sigs.k8s.io/yaml.

The addition of yaml is appropriate for YAML processing. Ensure that this library is used effectively in the codebase.


24-24: Verify the removal of the indirect dependency.

Ensure that the removal of the indirect dependency for sigs.k8s.io/yaml does not affect other parts of the codebase that might rely on it.

Run the following script to verify the impact of the removal:

apis/v1alpha1/greptimedbstandalone_types.go (1)

35-35: Field Renaming Approved: Ensure Consistent Usage.

The renaming of service port fields to HTTPPort, RPCPort, MySQLPort, and PostgreSQLPort improves clarity and consistency. Ensure that all references to these fields in the codebase have been updated accordingly.

Run the following script to verify the usage of these fields:

Also applies to: 38-38, 41-41, 44-44

Verification successful

Field Renaming Verified: Consistent Usage Across Codebase

The renaming of service port fields to HTTPPort, RPCPort, MySQLPort, and PostgreSQLPort has been consistently applied throughout the codebase. All references have been updated accordingly, ensuring clarity and uniformity.

  • Verified in test files, controller files, command files, and API type definitions.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all references to renamed fields in the codebase.

# Test: Search for the usage of renamed fields. Expect: Only occurrences of the new names.
rg --type go -e 'HTTPPort|RPCPort|MySQLPort|PostgreSQLPort'

Length of output: 10083

apis/v1alpha1/greptimedbcluster_types.go (1)

43-43: Field Renaming and Addition Approved: Ensure Consistent Usage.

The renaming and addition of fields such as RPCPort, HTTPPort, MySQLPort, and PostgreSQLPort improve clarity and configurability. Ensure that all references to these fields in the codebase have been updated accordingly.

Run the following script to verify the usage of these fields:

Also applies to: 47-47, 83-83, 87-87, 100-100, 132-132, 135-135, 138-138, 141-141

Verification successful

Field Renaming and Addition Verified: Consistent Usage Confirmed

The references to the fields RPCPort, HTTPPort, MySQLPort, and PostgreSQLPort have been consistently updated throughout the codebase. No outdated references were found, confirming that the renaming and addition have been properly applied.

  • Verified in files such as tests/e2e/greptimedbstandalone_test.go, controllers/greptimedbstandalone/deployer.go, and others.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all references to renamed and added fields in the codebase.

# Test: Search for the usage of renamed and added fields. Expect: Only occurrences of the new names.
rg --type go -e 'RPCPort|HTTPPort|MySQLPort|PostgreSQLPort'

Length of output: 10083

tests/e2e/greptimedbcluster_test.go (1)

66-66: Port Reference Update Approved: Run Tests to Ensure Success.

The update to use MySQLPort in the test cases aligns with the renaming of fields in the specifications. Ensure that the tests pass with the updated port reference.

Ensure that the tests are executed to verify their success with the updated port reference.

Also applies to: 126-126, 186-186

apis/v1alpha1/defaulting.go (4)

33-36: LGTM! Variable renaming improves clarity.

The renaming of service port variables enhances clarity and consistency in the codebase.


209-211: LGTM! Dynamic probe reconfiguration enhances maintainability.

The introduction of reconfigureProbe ensures that probe settings are dynamically updated based on the current configuration.


215-232: LGTM! Encapsulated probe configuration logic.

The reconfigureProbe function encapsulates the logic for adjusting probe settings, enhancing maintainability.


Line range hint 233-257: LGTM! Consistent use of new health endpoint.

The use of defaultHealthEndpoint in GreptimeDBStandalone aligns with the updated naming conventions and improves clarity.

controllers/greptimedbcluster/deployers/frontend.go (3)

245-250: LGTM! Updated container arguments for new ports.

The command-line arguments now correctly reference the new port names, ensuring proper configuration.


311-328: LGTM! Service port names updated for clarity.

The service port definitions now use the new naming conventions, enhancing clarity and consistency.


336-353: LGTM! Container port names updated for clarity.

The container port definitions now use the new naming conventions, enhancing clarity and consistency.

controllers/greptimedbcluster/deployers/meta.go (3)

338-340: LGTM! Updated container arguments for new ports.

The command-line arguments now correctly reference the new port names, ensuring proper configuration.


349-356: LGTM! Service port names updated for clarity.

The service port definitions now use the new naming conventions, enhancing clarity and consistency.


364-371: LGTM! Container port names updated for clarity.

The container port definitions now use the new naming conventions, enhancing clarity and consistency.

controllers/greptimedbcluster/deployers/flownode.go (4)

240-240: LGTM!

The change to use Flownode.RPCPort aligns with the new naming convention and is correct.


275-275: LGTM!

The change to use Flownode.RPCPort aligns with the new naming convention and is correct.


351-353: LGTM!

The change to use Flownode.RPCPort and rename the service to "rpc" aligns with the new naming convention and is correct.


363-363: LGTM!

The change to use Flownode.RPCPort and rename the port to "rpc" aligns with the new naming convention and is correct.

controllers/greptimedbstandalone/deployer.go (3)

Line range hint 355-370: LGTM!

The renaming of service ports for clarity and consistency aligns with the new naming convention and is correct.


Line range hint 380-395: LGTM!

The renaming of container ports for clarity and consistency aligns with the new naming convention and is correct.


404-407: LGTM!

The update to use the new port names in the command-line arguments aligns with the new naming convention and is correct.

controllers/greptimedbcluster/deployers/datanode.go (5)

215-215: LGTM!

The change to use RPCPort in the URL construction aligns with the new naming convention and is correct.


443-444: LGTM!

The update to use RPCPort and HTTPPort in the command-line arguments aligns with the new naming convention and is correct.


501-501: LGTM!

The change to use Datanode.RPCPort aligns with the new naming convention and is correct.


588-595: LGTM!

The change to use Datanode.RPCPort and Datanode.HTTPPort aligns with the new naming convention and is correct.


603-610: LGTM!

The change to use Datanode.RPCPort and Datanode.HTTPPort aligns with the new naming convention and is correct.

config/crd/resources/greptime.io_greptimedbstandalones.yaml (4)

2683-2683: Renaming to httpPort improves clarity.

The change from grpcServicePort to httpPort better reflects the service's purpose.


2712-2712: Renaming to mysqlPort simplifies the field name.

The change from mysqlServicePort to mysqlPort maintains clarity and consistency.


2761-2761: Renaming to postgreSQLPort aligns with convention.

The change from postgresServicePort to postgreSQLPort aligns with standard naming conventions.


2785-2787: Addition of rpcPort enhances configuration flexibility.

The new rpcPort field allows for specifying RPC-related configurations, adding flexibility.

config/crd/resources/greptime.io_greptimedbclusters.yaml (6)

2695-2697: Addition of httpPort in datanode is appropriate.

The httpPort field is correctly added with a format of int32.


2702-2704: Addition of rpcPort in datanode is appropriate.

The rpcPort field is correctly added with a format of int32.


5374-5376: Addition of rpcPort in flownode is appropriate.

The rpcPort field is correctly added with a format of int32.


10701-10703: Addition of httpPort in meta is appropriate.

The httpPort field is correctly added with a format of int32.


10708-10710: Addition of rpcPort in meta is appropriate.

The rpcPort field is correctly added with a format of int32.


Line range hint 13351-13400: Renaming of mysqlPort and postgreSQLPort is appropriate.

The renaming enhances clarity and consistency within the configuration.

manifests/greptimedb-operator-crd.yaml (6)

2694-2696: Addition of httpPort is consistent.

The httpPort property is correctly added with the appropriate type and format.


2701-2703: Addition of rpcPort is consistent.

The rpcPort property is correctly added with the appropriate type and format.


5373-5375: Addition of rpcPort is consistent.

The rpcPort property is correctly added with the appropriate type and format.


10700-10702: Addition of httpPort is consistent.

The httpPort property is correctly added with the appropriate type and format.


10707-10709: Addition of rpcPort is consistent.

The rpcPort property is correctly added with the appropriate type and format.


Line range hint 16200-16304: Addition of httpPort, mysqlPort, postgreSQLPort, and rpcPort is consistent.

The properties are correctly added with the appropriate type and format.

manifests/greptimedb-operator-deployment.yaml (6)

2701-2703: Addition of httpPort is well-structured.

The httpPort property is correctly defined with format: int32 and type: integer.


2708-2710: Addition of rpcPort is well-structured.

The rpcPort property is correctly defined with format: int32 and type: integer.


5380-5382: Addition of rpcPort in flownode is well-structured.

The rpcPort property is correctly defined with format: int32 and type: integer.


10707-10709: Addition of httpPort in meta is well-structured.

The httpPort property is correctly defined with format: int32 and type: integer.


10714-10716: Addition of rpcPort in meta is well-structured.

The rpcPort property is correctly defined with format: int32 and type: integer.


Line range hint 13357-13406: Renaming of port properties enhances clarity.

The renaming of mysqlServicePort to mysqlPort and postgresServicePort to postgreSQLPort improves consistency.

Comments failed to post (4)
apis/v1alpha1/testdata/greptimedbcluster/test02/expect.yaml

62-62: Add a newline at the end of the file.

The file is missing a newline at the end, which is a common convention in YAML files.

Apply this diff to add a newline:

+ 
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

            port: 4000

Tools
yamllint

[error] 62-62: no new line character at the end of file

(new-line-at-end-of-file)

apis/v1alpha1/defaulting_test.go

34-40: Handle file read errors properly.

The error handling for reading files should use t.Fatalf instead of t.Errorf to stop the test execution if a file cannot be read. This ensures that the test does not proceed with invalid data.

if err != nil {
	t.Fatalf("failed to read %s: %v", inputFile, err)
}

42-46: Handle file read errors properly.

Similar to the input file, use t.Fatalf for the expected file read error to ensure the test does not proceed with invalid data.

if err != nil {
	t.Fatalf("failed to read %s: %v", expectFile, err)
}
apis/v1alpha1/defaulting.go

30-30: Fix typo in variable name.

The variable name defautlHealthEndpoint contains a typo. It should be defaultHealthEndpoint.

Apply this diff to fix the typo:

-var defautlHealthEndpoint = "/health"
+var defaultHealthEndpoint = "/health"
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

	var defaultHealthEndpoint = "/health"

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (2)
apis/v1alpha1/testdata/greptimedbcluster/test02/expect.yaml (1)

62-62: Add a newline at the end of the file.

The file lacks a newline at the end, which is a common convention for text files.

Apply this diff to add a newline:

-  port: 4000
+  port: 4000
+
Tools
yamllint

[error] 62-62: no new line character at the end of file

(new-line-at-end-of-file)

controllers/greptimedbcluster/deployers/frontend.go (1)

Old Port Names Still Present in Codebase

The search results indicate that the old port name HTTPServicePort is still present in several files. These occurrences need to be updated to the new naming conventions to maintain consistency across the codebase.

  • controllers/greptimedbstandalone/deployer.go
  • apis/v1alpha1/greptimedbstandalone_types.go
  • apis/v1alpha1/defaulting.go

Please update these references to use the new port naming conventions.

Analysis chain

Line range hint 245-353: LGTM! Verify the usage of updated port names.

The changes improve clarity and consistency in port naming conventions.

Ensure that all references to the updated port names are correct throughout the codebase.

Run the following script to search for occurrences of the old port names:

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for occurrences of old port names.

# Test: Search for old port names. Expect: No occurrences of old port names.
rg --type go -e 'GRPCServicePort|HTTPServicePort|MySQLServicePort|PostgresServicePort'

Length of output: 569

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d03b578 and 3b091a4.

Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
Files selected for processing (26)
  • apis/v1alpha1/defaulting.go (9 hunks)
  • apis/v1alpha1/defaulting_test.go (1 hunks)
  • apis/v1alpha1/greptimedbcluster_types.go (4 hunks)
  • apis/v1alpha1/greptimedbstandalone_types.go (1 hunks)
  • apis/v1alpha1/testdata/greptimedbcluster/test00/expect.yaml (1 hunks)
  • apis/v1alpha1/testdata/greptimedbcluster/test00/input.yaml (1 hunks)
  • apis/v1alpha1/testdata/greptimedbcluster/test01/expect.yaml (1 hunks)
  • apis/v1alpha1/testdata/greptimedbcluster/test01/input.yaml (1 hunks)
  • apis/v1alpha1/testdata/greptimedbcluster/test02/expect.yaml (1 hunks)
  • apis/v1alpha1/testdata/greptimedbcluster/test02/input.yaml (1 hunks)
  • config/crd/resources/greptime.io_greptimedbclusters.yaml (7 hunks)
  • config/crd/resources/greptime.io_greptimedbstandalones.yaml (4 hunks)
  • controllers/greptimedbcluster/deployers/datanode.go (4 hunks)
  • controllers/greptimedbcluster/deployers/flownode.go (4 hunks)
  • controllers/greptimedbcluster/deployers/frontend.go (2 hunks)
  • controllers/greptimedbcluster/deployers/meta.go (2 hunks)
  • controllers/greptimedbstandalone/deployer.go (5 hunks)
  • go.mod (3 hunks)
  • manifests/greptimedb-operator-crd.yaml (11 hunks)
  • manifests/greptimedb-operator-deployment.yaml (11 hunks)
  • tests/e2e/greptimedbcluster_test.go (3 hunks)
  • tests/e2e/greptimedbstandalone_test.go (1 hunks)
  • tests/e2e/testdata/basic-cluster-with-flownode/cluster.yaml (1 hunks)
  • tests/e2e/testdata/basic-cluster/cluster.yaml (1 hunks)
  • tests/e2e/testdata/basic-standalone/standalone.yaml (1 hunks)
  • tests/e2e/testdata/cluster-with-remote-wal/cluster.yaml (1 hunks)
Files skipped from review due to trivial changes (9)
  • apis/v1alpha1/greptimedbcluster_types.go
  • apis/v1alpha1/testdata/greptimedbcluster/test00/expect.yaml
  • apis/v1alpha1/testdata/greptimedbcluster/test00/input.yaml
  • apis/v1alpha1/testdata/greptimedbcluster/test01/expect.yaml
  • apis/v1alpha1/testdata/greptimedbcluster/test02/input.yaml
  • config/crd/resources/greptime.io_greptimedbstandalones.yaml
  • tests/e2e/testdata/basic-cluster-with-flownode/cluster.yaml
  • tests/e2e/testdata/basic-cluster/cluster.yaml
  • tests/e2e/testdata/cluster-with-remote-wal/cluster.yaml
Files skipped from review as they are similar to previous changes (12)
  • apis/v1alpha1/defaulting.go
  • apis/v1alpha1/greptimedbstandalone_types.go
  • apis/v1alpha1/testdata/greptimedbcluster/test01/input.yaml
  • controllers/greptimedbcluster/deployers/datanode.go
  • controllers/greptimedbcluster/deployers/meta.go
  • controllers/greptimedbstandalone/deployer.go
  • go.mod
  • manifests/greptimedb-operator-crd.yaml
  • manifests/greptimedb-operator-deployment.yaml
  • tests/e2e/greptimedbcluster_test.go
  • tests/e2e/greptimedbstandalone_test.go
  • tests/e2e/testdata/basic-standalone/standalone.yaml
Additional context used
yamllint
apis/v1alpha1/testdata/greptimedbcluster/test02/expect.yaml

[error] 62-62: no new line character at the end of file

(new-line-at-end-of-file)

Additional comments not posted (13)
apis/v1alpha1/defaulting_test.go (1)

28-77: LGTM! Verify the presence of test data files.

The refactored test function enhances maintainability by using YAML files for test data.

Ensure that all necessary test data files are present in the testdata/greptimedbcluster directory.

Run the following script to list all test data directories and files:

controllers/greptimedbcluster/deployers/flownode.go (4)

240-240: LGTM! Consistent use of RPCPort.

The change to use RPCPort for metasrv-addrs is consistent with the new configuration strategy.


275-275: LGTM! Correct use of RPCPort in initializer.

The change to use RPCPort for the --rpc-port argument in the initializer is appropriate.


351-353: LGTM! Updated service port configuration.

The service port name change to "rpc" and use of RPCPort is consistent with the updated configuration.


363-363: LGTM! Consistent container port configuration.

The use of RPCPort for the container port configuration is consistent with the new setup.

config/crd/resources/greptime.io_greptimedbclusters.yaml (8)

2695-2697: Addition of httpPort is consistent with objectives.

The httpPort property has been correctly added with the appropriate format and type.


2702-2704: Addition of rpcPort is consistent with objectives.

The rpcPort property has been correctly added with the appropriate format and type.


5374-5376: Addition of rpcPort is consistent with objectives.

The rpcPort property has been correctly added with the appropriate format and type.


10701-10703: Addition of httpPort is consistent with objectives.

The httpPort property has been correctly added with the appropriate format and type.


10708-10710: Addition of rpcPort is consistent with objectives.

The rpcPort property has been correctly added with the appropriate format and type.


10681-10683: Addition of httpPort is consistent with objectives.

The httpPort property has been correctly added with the appropriate format and type.


13351-13353: Renaming to mysqlPort enhances clarity.

The property has been correctly renamed with the appropriate format and type.


13400-13402: Renaming to postgreSQLPort enhances clarity.

The property has been correctly renamed with the appropriate format and type.

@zyy17 zyy17 force-pushed the refactor/api branch 2 times, most recently from 6283522 to 5937a5f Compare August 22, 2024 15:41
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (1)
apis/v1alpha1/testdata/greptimedbcluster/test02/expect.yaml (1)

66-66: Add a newline at the end of the file.

The file should end with a newline character to adhere to POSIX standards.

Tools
yamllint

[error] 66-66: no new line character at the end of file

(new-line-at-end-of-file)

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3b091a4 and 5937a5f.

Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
Files selected for processing (26)
  • apis/v1alpha1/defaulting.go (6 hunks)
  • apis/v1alpha1/defaulting_test.go (1 hunks)
  • apis/v1alpha1/greptimedbcluster_types.go (4 hunks)
  • apis/v1alpha1/greptimedbstandalone_types.go (1 hunks)
  • apis/v1alpha1/testdata/greptimedbcluster/test00/expect.yaml (1 hunks)
  • apis/v1alpha1/testdata/greptimedbcluster/test00/input.yaml (1 hunks)
  • apis/v1alpha1/testdata/greptimedbcluster/test01/expect.yaml (1 hunks)
  • apis/v1alpha1/testdata/greptimedbcluster/test01/input.yaml (1 hunks)
  • apis/v1alpha1/testdata/greptimedbcluster/test02/expect.yaml (1 hunks)
  • apis/v1alpha1/testdata/greptimedbcluster/test02/input.yaml (1 hunks)
  • config/crd/resources/greptime.io_greptimedbclusters.yaml (7 hunks)
  • config/crd/resources/greptime.io_greptimedbstandalones.yaml (4 hunks)
  • controllers/greptimedbcluster/deployers/datanode.go (4 hunks)
  • controllers/greptimedbcluster/deployers/flownode.go (4 hunks)
  • controllers/greptimedbcluster/deployers/frontend.go (2 hunks)
  • controllers/greptimedbcluster/deployers/meta.go (2 hunks)
  • controllers/greptimedbstandalone/deployer.go (5 hunks)
  • go.mod (4 hunks)
  • manifests/greptimedb-operator-crd.yaml (11 hunks)
  • manifests/greptimedb-operator-deployment.yaml (11 hunks)
  • tests/e2e/greptimedbcluster_test.go (3 hunks)
  • tests/e2e/greptimedbstandalone_test.go (1 hunks)
  • tests/e2e/testdata/basic-cluster-with-flownode/cluster.yaml (1 hunks)
  • tests/e2e/testdata/basic-cluster/cluster.yaml (1 hunks)
  • tests/e2e/testdata/basic-standalone/standalone.yaml (1 hunks)
  • tests/e2e/testdata/cluster-with-remote-wal/cluster.yaml (1 hunks)
Files skipped from review due to trivial changes (6)
  • apis/v1alpha1/testdata/greptimedbcluster/test00/expect.yaml
  • apis/v1alpha1/testdata/greptimedbcluster/test00/input.yaml
  • apis/v1alpha1/testdata/greptimedbcluster/test02/input.yaml
  • config/crd/resources/greptime.io_greptimedbstandalones.yaml
  • tests/e2e/testdata/basic-cluster/cluster.yaml
  • tests/e2e/testdata/cluster-with-remote-wal/cluster.yaml
Files skipped from review as they are similar to previous changes (14)
  • apis/v1alpha1/defaulting.go
  • apis/v1alpha1/greptimedbstandalone_types.go
  • apis/v1alpha1/testdata/greptimedbcluster/test01/expect.yaml
  • apis/v1alpha1/testdata/greptimedbcluster/test01/input.yaml
  • controllers/greptimedbcluster/deployers/datanode.go
  • controllers/greptimedbcluster/deployers/meta.go
  • controllers/greptimedbstandalone/deployer.go
  • go.mod
  • manifests/greptimedb-operator-crd.yaml
  • manifests/greptimedb-operator-deployment.yaml
  • tests/e2e/greptimedbcluster_test.go
  • tests/e2e/greptimedbstandalone_test.go
  • tests/e2e/testdata/basic-cluster-with-flownode/cluster.yaml
  • tests/e2e/testdata/basic-standalone/standalone.yaml
Additional context used
yamllint
apis/v1alpha1/testdata/greptimedbcluster/test02/expect.yaml

[error] 66-66: no new line character at the end of file

(new-line-at-end-of-file)

Additional comments not posted (18)
apis/v1alpha1/defaulting_test.go (1)

27-83: Great use of data-driven testing!

The refactor to use YAML files for test inputs and expected outputs enhances maintainability and scalability. The use of reflect.DeepEqual and diffmatchpatch for comparison and diff visualization is a robust choice.

apis/v1alpha1/greptimedbcluster_types.go (4)

41-47: Improved configurability for MetaSpec.

The addition of RPCPort and HTTPPort fields enhances the configurability and clarity of the MetaSpec.


81-87: Enhanced configurability for DatanodeSpec.

The inclusion of RPCPort and HTTPPort fields improves the configurability of the DatanodeSpec.


98-100: Added RPCPort to FlownodeSpec.

The addition of the RPCPort field enhances the configurability of the FlownodeSpec.


132-141: Standardized naming conventions in GreptimeDBClusterSpec.

The renaming of service port fields to HTTPPort, RPCPort, MySQLPort, and PostgreSQLPort standardizes naming conventions and clarifies their purpose.

controllers/greptimedbcluster/deployers/frontend.go (3)

245-250: LGTM: Updated port references enhance clarity.

The changes to use RPCPort, HTTPPort, MySQLPort, and PostgreSQLPort improve naming consistency.


311-328: LGTM: Updated service port names enhance clarity.

The changes to use "rpc" and "pg" for service port names improve naming consistency.


336-353: LGTM: Updated container port names enhance clarity.

The changes to use "rpc" and "pg" for container port names improve naming consistency.

controllers/greptimedbcluster/deployers/flownode.go (4)

240-240: LGTM: Updated address construction enhances clarity.

The change to use RPCPort for constructing the metadata service address is consistent with the new naming conventions.


275-275: LGTM: Updated initializer arguments enhance clarity.

The change to use Flownode.RPCPort for the RPC port configuration is consistent with the new naming conventions.


351-353: LGTM: Updated service port name enhances clarity.

The change to use "rpc" for the service port name is consistent with the new naming conventions.


363-363: LGTM: Updated container port name enhances clarity.

The change to use Flownode.RPCPort for the container port configuration is consistent with the new naming conventions.

config/crd/resources/greptime.io_greptimedbclusters.yaml (6)

2695-2697: Addition of httpPort is correct.

The httpPort property is correctly added with format: int32 and type: integer.


2702-2704: Addition of rpcPort is correct.

The rpcPort property is correctly added with format: int32 and type: integer.


5374-5376: Addition of rpcPort is correct.

The rpcPort property is correctly added with format: int32 and type: integer.


10701-10703: Addition of httpPort is correct.

The httpPort property is correctly added with format: int32 and type: integer.


10708-10710: Addition of rpcPort is correct.

The rpcPort property is correctly added with format: int32 and type: integer.


Line range hint 13351-13426: Addition of mysqlPort, postgreSQLPort, and rpcPort is correct.

The properties are correctly added with format: int32 and type: integer.

1. Refactor 'SetDefaults()' of GreptimeDBCluster to fix probe port setting issue;

2. Use livenessProbe instead of readinessProbe;

3. Refine the naming of `*port` filed in GreptimeDBCluster and GreptimeDBStandalone;

4. Refine the unit test structure of `defaulting_test.go`;

Signed-off-by: zyy17 <zyylsxm@gmail.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (7)
apis/v1alpha1/defaulting_test.go (3)

18-24: Consider organizing imports.

The imports could be organized for better readability, separating standard library imports from third-party ones.


27-37: Ensure test directory exists.

Consider adding a check to ensure that the testDir exists before attempting to read its contents, to provide a clearer error message if the directory is missing.

 entries, err := os.ReadDir(testDir)
 if err != nil {
+    t.Fatalf("test directory %s does not exist: %v", testDir, err)
     t.Fatal(err)
 }

39-83: Improve error messages for YAML processing.

The error messages for YAML unmarshalling and file reading could include more context about the specific file being processed to aid in debugging.

 if err := yaml.Unmarshal(inputData, &input); err != nil {
-    t.Fatalf("failed to unmarshal %s: %v", inputFile, err)
+    t.Fatalf("failed to unmarshal input file %s: %v", inputFile, err)
 }
 if err := yaml.Unmarshal(expectData, &expect); err != nil {
-    t.Fatalf("failed to unmarshal %s: %v", expectFile, err)
+    t.Fatalf("failed to unmarshal expected file %s: %v", expectFile, err)
 }
controllers/greptimedbcluster/deployers/frontend.go (3)

245-250: Update Port Naming Conventions Across Codebase

The codebase still contains references to the old port naming convention HTTPServicePort. Please update these references to align with the new naming conventions.

  • controllers/greptimedbstandalone/deployer.go: Lines with HTTPServicePort
  • apis/v1alpha1/greptimedbstandalone_types.go: Line with HTTPServicePort
  • apis/v1alpha1/defaulting.go: Line with HTTPServicePort
Analysis chain

Clarify port configuration logic.

The changes to port configuration align with the new naming conventions. Ensure that all references to these ports are updated throughout the codebase.

Run the following script to verify the usage of these port variables:

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all references to the updated port variables.

# Test: Search for the old port names. Expect: No occurrences of old port names.
rg --type go 'GRPCServicePort|HTTPServicePort|MySQLServicePort|PostgresServicePort'

Length of output: 566


336-353: Review and Update Container Port Names

The container port names "grpc" and "postgres" are still present in several files. Please review and update these instances to ensure consistency across the codebase:

  • pkg/dbconfig/flownode_config.go
  • cmd/initializer/internal/config_generator_test.go
  • controllers/greptimedbstandalone/deployer.go
  • controllers/greptimedbcluster/deployers/meta.go
  • controllers/greptimedbcluster/deployers/frontend.go
  • controllers/greptimedbcluster/deployers/flownode.go
Analysis chain

Ensure container port changes are reflected elsewhere.

The container port names have been updated. Verify that these changes are consistently applied across the codebase, particularly in deployment configurations.

Run the following script to verify the container port updates:

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all references to the updated container port names.

# Test: Search for the old container port names. Expect: No occurrences of old container port names.
rg --type go 'grpc|postgres'

Length of output: 1180


311-328: Inconsistent Service Port Name Updates Detected

The service port names have not been consistently updated across the codebase. The old service port names 'grpc' and 'postgres' are still present in several files, including deployment configurations.

  • pkg/dbconfig/flownode_config.go
  • controllers/greptimedbcluster/deployers/frontend.go
  • controllers/greptimedbcluster/deployers/flownode.go
  • controllers/greptimedbstandalone/deployer.go
  • controllers/greptimedbcluster/deployers/meta.go
  • cmd/initializer/internal/config_generator_test.go

Please ensure these references are updated to reflect the new service port names.

Analysis chain

Ensure service port changes are reflected elsewhere.

The service port names have been updated. Verify that these changes are consistently applied across the codebase, particularly in deployment configurations.

Run the following script to verify the service port updates:

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all references to the updated service port names.

# Test: Search for the old service port names. Expect: No occurrences of old service port names.
rg --type go 'grpc|postgres'

Length of output: 1180

controllers/greptimedbcluster/deployers/flownode.go (1)

351-353: Ensure consistent service port name updates across the codebase.

The service port name "rpc" has been applied in many places, but there are still occurrences of the old name "grpc" in the following files. Please verify and update these occurrences to ensure consistency:

  • pkg/dbconfig/flownode_config.go
  • controllers/greptimedbstandalone/deployer.go
  • controllers/greptimedbcluster/deployers/flownode.go
Analysis chain

Ensure service port changes are reflected elsewhere.

The service port name has been updated. Verify that these changes are consistently applied across the codebase, particularly in deployment configurations.

Run the following script to verify the service port updates:

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all references to the updated service port names.

# Test: Search for the old service port names. Expect: No occurrences of old service port names.
rg --type go 'grpc'

Length of output: 766


Script:

#!/bin/bash
# Description: Verify all references to the new service port name "rpc".

# Test: Search for occurrences of the new service port name "rpc".
rg --type go 'rpc'

Length of output: 4047

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5937a5f and d568bb4.

Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
Files selected for processing (26)
  • apis/v1alpha1/defaulting.go (6 hunks)
  • apis/v1alpha1/defaulting_test.go (1 hunks)
  • apis/v1alpha1/greptimedbcluster_types.go (4 hunks)
  • apis/v1alpha1/greptimedbstandalone_types.go (1 hunks)
  • apis/v1alpha1/testdata/greptimedbcluster/test00/expect.yaml (1 hunks)
  • apis/v1alpha1/testdata/greptimedbcluster/test00/input.yaml (1 hunks)
  • apis/v1alpha1/testdata/greptimedbcluster/test01/expect.yaml (1 hunks)
  • apis/v1alpha1/testdata/greptimedbcluster/test01/input.yaml (1 hunks)
  • apis/v1alpha1/testdata/greptimedbcluster/test02/expect.yaml (1 hunks)
  • apis/v1alpha1/testdata/greptimedbcluster/test02/input.yaml (1 hunks)
  • config/crd/resources/greptime.io_greptimedbclusters.yaml (7 hunks)
  • config/crd/resources/greptime.io_greptimedbstandalones.yaml (4 hunks)
  • controllers/greptimedbcluster/deployers/datanode.go (4 hunks)
  • controllers/greptimedbcluster/deployers/flownode.go (4 hunks)
  • controllers/greptimedbcluster/deployers/frontend.go (2 hunks)
  • controllers/greptimedbcluster/deployers/meta.go (2 hunks)
  • controllers/greptimedbstandalone/deployer.go (5 hunks)
  • go.mod (4 hunks)
  • manifests/greptimedb-operator-crd.yaml (11 hunks)
  • manifests/greptimedb-operator-deployment.yaml (11 hunks)
  • tests/e2e/greptimedbcluster_test.go (3 hunks)
  • tests/e2e/greptimedbstandalone_test.go (1 hunks)
  • tests/e2e/testdata/basic-cluster-with-flownode/cluster.yaml (1 hunks)
  • tests/e2e/testdata/basic-cluster/cluster.yaml (1 hunks)
  • tests/e2e/testdata/basic-standalone/standalone.yaml (1 hunks)
  • tests/e2e/testdata/cluster-with-remote-wal/cluster.yaml (1 hunks)
Files skipped from review due to trivial changes (7)
  • apis/v1alpha1/testdata/greptimedbcluster/test00/expect.yaml
  • apis/v1alpha1/testdata/greptimedbcluster/test00/input.yaml
  • apis/v1alpha1/testdata/greptimedbcluster/test01/expect.yaml
  • apis/v1alpha1/testdata/greptimedbcluster/test02/input.yaml
  • config/crd/resources/greptime.io_greptimedbstandalones.yaml
  • tests/e2e/testdata/basic-cluster/cluster.yaml
  • tests/e2e/testdata/cluster-with-remote-wal/cluster.yaml
Files skipped from review as they are similar to previous changes (15)
  • apis/v1alpha1/defaulting.go
  • apis/v1alpha1/greptimedbcluster_types.go
  • apis/v1alpha1/greptimedbstandalone_types.go
  • apis/v1alpha1/testdata/greptimedbcluster/test01/input.yaml
  • apis/v1alpha1/testdata/greptimedbcluster/test02/expect.yaml
  • config/crd/resources/greptime.io_greptimedbclusters.yaml
  • controllers/greptimedbcluster/deployers/datanode.go
  • controllers/greptimedbcluster/deployers/meta.go
  • controllers/greptimedbstandalone/deployer.go
  • go.mod
  • manifests/greptimedb-operator-deployment.yaml
  • tests/e2e/greptimedbcluster_test.go
  • tests/e2e/greptimedbstandalone_test.go
  • tests/e2e/testdata/basic-cluster-with-flownode/cluster.yaml
  • tests/e2e/testdata/basic-standalone/standalone.yaml
Additional comments not posted (15)
controllers/greptimedbcluster/deployers/flownode.go (3)

275-275: Ensure initializer configuration changes are reflected elsewhere.

The initializer configuration now uses Flownode.RPCPort. Verify that these changes are consistently applied across the codebase.

Run the following script to verify the initializer configuration updates:

Verification successful

Initializer Configuration Changes Verified

The initializer configuration change to use Flownode.RPCPort is consistently applied across the codebase. No occurrences of the old configuration format GRPCServicePort were found.

  • Flownode.RPCPort is used in:
    • controllers/greptimedbcluster/deployers/flownode.go at multiple locations.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all references to the initializer configuration.

# Test: Search for the old initializer configuration. Expect: No occurrences of old configuration format.
rg --type go 'GRPCServicePort'

Length of output: 30


Script:

#!/bin/bash
# Search for all occurrences of Flownode.RPCPort to verify its consistent application.
rg --type go 'Flownode.RPCPort'

Length of output: 353


363-363: Ensure container port changes are reflected elsewhere.

The container port name has been updated. Verify that these changes are consistently applied across the codebase, particularly in deployment configurations.

Run the following script to verify the container port updates:

Verification successful

Container port changes are consistently applied.

The new container port name "RPCPort" is used consistently across the codebase, including in deployment configurations and other relevant files. The changes appear to be correctly reflected.

  • The new container port name is used in multiple files, confirming consistent updates.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all references to the updated container port names.

# Test: Search for the old container port names. Expect: No occurrences of old container port names.
rg --type go 'grpc'

Length of output: 766


Script:

#!/bin/bash
# Search for the new container port name in the codebase to verify its usage.
rg --type go 'RPCPort'

Length of output: 4866


240-240: Clarify metadata service address logic.

The change to use RPCPort for the metadata service address aligns with the new configuration strategy. Ensure that all references to this address are updated throughout the codebase.

Run the following script to verify the usage of the metadata service address:

Verification successful

Metadata service address logic is consistent.

The transition to using RPCPort for the metadata service address is complete and consistent across the codebase. No occurrences of the old GRPCServicePort format were found.

  • The new RPCPort format is used in multiple files, including controllers/greptimedbcluster/deployers/flownode.go.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all references to the metadata service address.

# Test: Search for the old metadata service address. Expect: No occurrences of old address format.
rg --type go 'GRPCServicePort'

Length of output: 30


Script:

#!/bin/bash
# Description: Verify all references to the new metadata service address format.

# Test: Search for the new metadata service address format. Expect: Occurrences of RPCPort.
rg --type go 'RPCPort'

Length of output: 4866

manifests/greptimedb-operator-crd.yaml (12)

2694-2696: Addition of httpPort property is appropriate.

The introduction of the httpPort property with int32 format and integer type is consistent with the schema's naming conventions and type definitions.


2701-2703: Addition of rpcPort property is appropriate.

The introduction of the rpcPort property with int32 format and integer type is consistent with the schema's naming conventions and type definitions.


5373-5375: Addition of rpcPort property is appropriate.

The introduction of the rpcPort property with int32 format and integer type is consistent with the schema's naming conventions and type definitions.


10680-10682: Addition of httpPort property is appropriate.

The introduction of the httpPort property with int32 format and integer type is consistent with the schema's naming conventions and type definitions.


10700-10702: Addition of httpPort property is appropriate.

The introduction of the httpPort property with int32 format and integer type is consistent with the schema's naming conventions and type definitions.


10707-10709: Addition of rpcPort property is appropriate.

The introduction of the rpcPort property with int32 format and integer type is consistent with the schema's naming conventions and type definitions.


13350-13352: Addition of mysqlPort property is appropriate.

The introduction of the mysqlPort property with int32 format and integer type is consistent with the schema's naming conventions and type definitions.


13399-13401: Addition of postgreSQLPort property is appropriate.

The introduction of the postgreSQLPort property with int32 format and integer type is consistent with the schema's naming conventions and type definitions.


13423-13425: Addition of rpcPort property is appropriate.

The introduction of the rpcPort property with int32 format and integer type is consistent with the schema's naming conventions and type definitions.


16200-16202: Addition of httpPort property is appropriate.

The introduction of the httpPort property with int32 format and integer type is consistent with the schema's naming conventions and type definitions.


16229-16231: Addition of mysqlPort property is appropriate.

The introduction of the mysqlPort property with int32 format and integer type is consistent with the schema's naming conventions and type definitions.


16278-16280: Addition of postgreSQLPort property is appropriate.

The introduction of the postgreSQLPort property with int32 format and integer type is consistent with the schema's naming conventions and type definitions.

@zyy17 zyy17 merged commit bb16e08 into GreptimeTeam:develop Aug 23, 2024
5 checks passed
@zyy17 zyy17 deleted the refactor/api branch August 23, 2024 11:00
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.

2 participants