-
Notifications
You must be signed in to change notification settings - Fork 65
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: Improve chectl KubeHelper class and context #1085
Conversation
…ntext Signed-off-by: Flavius Lacatusu <flacatus@redhat.com>
Having two contexts might be very dengeros, especially with missing typings ( |
We have 2 methods in k8sCTX |
It is not ideal solution, but maybe we can have sort of inheritance with contexts: |
Ok for me, but the call might change from |
Signed-off-by: Flavius Lacatusu <flacatus@redhat.com>
Signed-off-by: Flavius Lacatusu <flacatus@redhat.com>
Signed-off-by: Flavius Lacatusu <flacatus@redhat.com>
Signed-off-by: Flavius Lacatusu <flacatus@redhat.com>
/retest |
1 similar comment
/retest |
task: async (ctx: any, task: any) => { | ||
try { | ||
await kube.checkKubeApi() | ||
cli.info(`› Current Kubernetes context: '${await kube.currentContext()}'`) |
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.
Not all the commands use these API tasks. Is it planned to print the message on a subset of commands only?
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.
Basically this task is run only when k8s api is used.
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 added a few suggestions for improvements, other than that no more questions from my side.
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: AndrienkoAleksandr, flacatus, mmorhun, tolusha 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 |
Signed-off-by: Flavius Lacatusu flacatus@redhat.com
What does this PR do?
Improve chectl context and improve kubeHelper class to not initialize kube context in every command.
Ref issue: eclipse-che/che#18684
Screenshot/screencast of this PR
What issues does this PR fix or reference?
How to test this PR?
PR Checklist
As the author of this Pull Request I made sure that:
What issues does this PR fix or reference
andHow to test this PR
completedReviewers
Reviewers, please comment how you tested the PR when approving it.