-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
fix: kube client when have multiple kubeconfig and fix stop port forward #293
Conversation
Caution Review failedThe pull request is closed. WalkthroughThe changes involve refactoring the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Client
participant KubeconfigManager
User->>Client: create_client_with_specific_context(kubeconfig, context_name)
Client->>KubeconfigManager: get_kubeconfig_paths_from_option(kubeconfig)
KubeconfigManager-->>Client: return kubeconfig paths
Client->>KubeconfigManager: create_config_with_context(kubeconfig, context_name)
KubeconfigManager-->>Client: return Config
Client->>Client: create_client_with_config(Config)
Client-->>User: return Option<Client>
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this 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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (3)
Cargo.lock
is excluded by!**/*.lock
,!**/*.lock
crates/kftray-portforward/Cargo.toml
is excluded by!**/*.toml
crates/kftray-tauri/Cargo.toml
is excluded by!**/*.toml
Files selected for processing (1)
- crates/kftray-portforward/src/client.rs (3 hunks)
Additional comments not posted (5)
crates/kftray-portforward/src/client.rs (5)
Line range hint
12-78
: LGTM!The function is well-structured with improved error handling and logging. The fallback mechanism to use Rustls if OpenSSL fails enhances robustness.
The code changes are approved.
80-95
: LGTM!The function effectively handles different scenarios for retrieving kubeconfig paths.
The code changes are approved.
97-111
: LGTM!The function is correctly implemented with informative logging.
The code changes are approved.
113-153
: LGTM!The function is well-structured with improved error handling and logging. The fallback mechanism to use Rustls if OpenSSL fails enhances robustness.
The code changes are approved.
Line range hint
154-158
: LGTM!The function is correctly implemented and straightforward.
The code changes are approved.
There was a problem hiding this 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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- crates/kftray-portforward/src/client.rs (3 hunks)
- crates/kftray-portforward/src/core.rs (4 hunks)
Additional comments not posted (10)
crates/kftray-portforward/src/client.rs (7)
18-22
: LGTM!The logging improvements are clear and informative.
The code changes are approved.
28-32
: LGTM!The refactoring improves readability and modularity.
The code changes are approved.
Line range hint
35-50
: LGTM!The logging improvements are clear and informative.
The code changes are approved.
56-84
: LGTM!The error handling and logging improvements are clear and informative.
The code changes are approved.
95-110
: LGTM!The new helper function
get_kubeconfig_paths_from_option
is well-structured and improves modularity.The code changes are approved.
112-123
: LGTM!The new helper function
create_config_with_context
is well-structured and improves modularity.The code changes are approved.
125-165
: LGTM!The new helper function
create_client_with_config
is well-structured and improves modularity. The fallback mechanism for OpenSSL and Rustls is implemented correctly.The code changes are approved.
crates/kftray-portforward/src/core.rs (3)
260-267
: LGTM!The new client creation process enhances error handling and robustness.
The code changes are approved.
566-568
: LGTM!The new client creation process enhances error handling and robustness.
The code changes are approved.
700-707
: LGTM!The new client creation process enhances error handling and robustness.
The code changes are approved.
fix: try to create client it using openssl, if error try using the rust-tls
relates: #289
fix: fix client and logic to stop port
relates: #292