-
Notifications
You must be signed in to change notification settings - Fork 41
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
OLS-1379: Add oc tools #2216
base: main
Are you sure you want to change the base?
OLS-1379: Add oc tools #2216
Conversation
@onmete: This pull request references OLS-1379 which is a valid jira issue. In 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@asamal4 this should be easy to integrate once you have your PR ready. |
/hold |
ols/src/tools/oc_cli.py
Outdated
raise e | ||
|
||
|
||
def oc_get(args: list[str]) -> subprocess.CompletedProcess: |
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.
input type: Why it is list[str] ? shouldn't it be just str ?
output type: I haven't tested, but I am thinking we can keep this as str (we can convert the output to str)
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.
Yup, output should be a string.
As for the input, technically it is a list of strings. From my experiments, llm had no issue returning it, but I'll try to double-check what is better understandable to the llm (list of strings/one string).
ols/src/tools/oc_cli.py
Outdated
# List one or more resources by their type and names. | ||
oc get rc/web service/frontend pods/web-pod-13je7 | ||
""" | ||
result = run_oc(["get", *sanitize_oc_args(args)]) |
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.
What will be the args value ? part of the command except oc get
?
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.
yes, besides sanitization, we can also catch the case when llm returns not just the args, but the full command oc get whatever
instead of just whatever
.
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.
Probably we are relying too much on model to generate the command here. Also this will require us to handle lot of corner cases (lot of rules to sanitize).
Anyways let's see if others have any opinion on this.
/assign @asamal4 |
@onmete: This pull request references OLS-1379 which is a valid jira issue. In 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. |
@onmete: all tests passed! Full PR test history. Your PR dashboard. 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 kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Description
Adding oc tools.
OLS-1410
Type of change