-
Notifications
You must be signed in to change notification settings - Fork 55
Add support to set client with cluster proxy #2066
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
Add support to set client with cluster proxy #2066
Conversation
Report bugs in Issues The following are automatically added:
Available user actions:
Supported /retest check runs
Supported labels
|
WalkthroughThe update modifies the Changes
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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
/verified |
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 (1)
- ocp_resources/resource.py (2 hunks)
Additional comments not posted (1)
ocp_resources/resource.py (1)
115-127
: Verify proxy configuration logic.The logic for configuring the client with a proxy is well-implemented. Ensure that the proxy settings are correctly applied and that any potential proxy-related issues are handled appropriately.
Run the following script to verify the proxy configuration logic:
Verification successful
Proxy Configuration Logic Verified
The proxy configuration logic in the
get_client
function is correctly implemented. The code sets the proxy in the client configuration and uses it to create the API client, ensuring proper handling of proxy settings.
- Location:
ocp_resources/resource.py
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the proxy configuration logic is correctly applied. # Test: Search for the proxy configuration logic. Expect: Proper handling of proxy settings. rg --type python -A 5 $'client_configuration.proxy = proxy'Length of output: 91
Script:
#!/bin/bash # Description: Verify that the proxy configuration logic is correctly applied. # Test: Search for the proxy configuration logic. Expect: Proper handling of proxy settings. rg --type py -A 5 $'client_configuration.proxy = proxy'Length of output: 517
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 (1)
- ocp_resources/resource.py (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- ocp_resources/resource.py
/verified |
Signed-off-by: Shahaf Bahar <[email protected]>
Signed-off-by: Shahaf Bahar <[email protected]>
6d6ea0e
to
500ee4f
Compare
/verified |
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 (1)
- ocp_resources/resource.py (4 hunks)
Files skipped from review as they are similar to previous changes (1)
- ocp_resources/resource.py
# kubernetes.config.kube_config.load_kube_config sets KUBE_CONFIG_DEFAULT_LOCATION during module import. | ||
# If `KUBECONFIG` environment variable is set via code, the `KUBE_CONFIG_DEFAULT_LOCATION` will be None since | ||
# is populated during import which comes before setting the variable in code. | ||
config_file = config_file or os.environ.get("KUBECONFIG", "~/.kube/config") | ||
client_configuration = client_configuration or client.Configuration() | ||
proxy = os.environ.get("HTTPS_PROXY") or os.environ.get("HTTP_PROXY") |
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.
User will give as configured client_configuration
and we just use it.
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.
It will make the implementation very complicated on the caller side if we omit this important option.
Please consider keeping the proxy to be set additionally as environment variable.
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.
I can add logic to override the proxy part if it's already being configured in the client_configuration regardless of being set by environment variable.
@sbahar619 this can be closed right? if so please close the PR |
Right now yes, but we need to solve this issue, I will write a solution proposal to decide on the agreed solution. |
@sbahar619 Which issue are you trying to solve? |
To configure the client to use proxy, currently to implement it in cnv-tests will be complicated so before I will start working on it, I will create a document about the possible implementation solutions and after agreement I will start. |
Short description:
Add support to set client with cluster proxy
More details:
What this PR does / why we need it:
Which issue(s) this PR fixes:
https://issues.redhat.com/browse/CNV-46351
Special notes for reviewer:
Bug:
Summary by CodeRabbit
New Features
Bug Fixes