-
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
feat: Print the current context when chectl is run #647
Conversation
Signed-off-by: Anatoliy Bazko <[email protected]>
Signed-off-by: Anatoliy Bazko <[email protected]>
[test] |
Signed-off-by: Anatoliy Bazko <[email protected]>
Signed-off-by: Anatoliy Bazko <[email protected]>
After digging into the code I figured out that if (process.env.KUBECONFIG && process.env.KUBECONFIG.length > 0) {
const files = process.env.KUBECONFIG.split(path.delimiter);
this.loadFromFile(files[0]);
for (let i = 1; i < files.length; i++) {
const kc = new KubeConfig();
kc.loadFromFile(files[i]);
this.mergeConfig(kc);
}
return;
} So, I've decided just to print the current context |
Signed-off-by: Anatoliy Bazko <[email protected]>
[test] |
kc = new KubeConfig() | ||
portForwardHelper = new PortForward(this.kc, true) | ||
logHelper = new Log(this.kc) | ||
public static readonly KUBE_CONFIG = KubeHelper.initializeKubeConfig() |
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 am not keen on the idea to make kubeconfig static.
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.
Why?
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.
KubeHelper
is helper class which is used to communicate with Kubernetes API. By making kubeconfig static you basically make whole class static, so it becomes more a namespace than a class... It is my vision...
[test] |
Signed-off-by: Anatoliy Bazko [email protected]
What does this PR do?
Prints the current context when chectl is run
What issues does this PR fix or reference?
eclipse-che/che#15741