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: make privatelink.endpoint accept json array #20154

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

tabVersion
Copy link
Contributor

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

resolve cloud issue

Checklist

  • I have written necessary rustdoc comments.
  • I have added necessary unit tests and integration tests.
  • I have added test labels as necessary.
  • I have added fuzzing tests or opened an issue to track them.
  • My PR contains breaking changes.
  • My PR changes performance-critical code, so I will run (micro) benchmarks and present the results.
  • My PR contains critical fixes that are necessary to be merged into the latest release.

Documentation

  • My PR needs documentation updates.
Release note
        // new syntax: endpoint can either be a string or a json array of strings
        // if it is a string, rewrite all broker addresses to the same endpoint
        // eg. privatelink.endpoint='some_url'
        // ==> broker1:9092 -> some_url:9092, broker2:9093 -> some_url:9093
        //
        // if it is a json array, rewrite each broker address to the corresponding endpoint
        // eg. privatelink.endpoint = '[{"host": "aaaa"}, {"host": "bbbb"}, {"host": "cccc"}]'
        // ==> broker1:9092 -> aaaa:9092, broker2:9093 -> bbbb:9093, broker3:9094 -> cccc:9094

link_targets: &[AwsPrivateLinkItem],
broker_addrs: &[&str],
) -> ConnectorResult<()> {
let endpoint = if let Ok(json) = serde_json::from_str::<serde_json::Value>(endpoint) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

here we introduce a potential risk is if the user input an illegal json, which cannot be parsed, we will see it as a string, instead of returning error. The case seems acceptable to me because he cannot connect to the broker using the wrong endpoint addr and he will find out later.

@tabVersion
Copy link
Contributor Author

convert to draft for now as the poc user does not need it.

@tabVersion tabVersion marked this pull request as draft January 14, 2025 08:28
@tabVersion tabVersion marked this pull request as ready for review January 15, 2025 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants