-
Notifications
You must be signed in to change notification settings - Fork 216
NO-JIRA: More flexible timeout option for oc-cli #1311
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
Conversation
WalkthroughThis change refactors the OC client initialization API to use an Options struct instead of direct parameter passing. A new Options type is introduced containing Logger and Timeout fields. Function signatures for NewOC and NewOCCli are updated to accept Options, with timeout configuration moving from environment variables to the Options.Timeout field with a 30-second default. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
|
Skipping CI for Draft Pull Request. |
|
/hold Let's discuss it together, may be @jhou1 wants to join? |
|
If we add Timeout in the structure function, the timeout setting will be fixed, that means we have to instantiate oc client for each case. |
I do not see why for each case. The oc with default timeout (30s). If you do not want to use it because the timeout is too short, you may create a new one for it. There are only a few cases like it, right? Do you want a timeout for each cmd? |
|
I'd like to put the oc client instantiation scripts into |
I am fine with it but that is not really a blocker of this pull, right? What I did here is only making the API more easier to use: Parameters in an option vs Environment variable. |
|
@hongkailiu: This pull request explicitly references no jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hongkailiu, JianLi-RH The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
We need to do more optimize to the timeout setting, but not urgent. |
For future ourselves, what Jian wants is a setter to change the timeout for an existing oc instance. |
|
/hold cancel |
|
As far as I know, no tests uses the env. vars to configure the timeout. /verified by @hongkailiu |
|
@hongkailiu: This PR has been marked as verified by DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@hongkailiu: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Follow up #1309 (comment)
We made an
optiontype for oc cmd.Currently, it is mostly
timeoutfor running the command. The current implementation use it as the timeout for the context when spawning the process.The
optionalso gives the flexibility to introduce other options for oc./cc @JianLi-RH