Skip to content
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

odo list does not work if KUBECONFIG env var points to multiple kubeconfig files #6700

Closed
rm3l opened this issue Mar 30, 2023 · 4 comments · Fixed by #7017
Closed

odo list does not work if KUBECONFIG env var points to multiple kubeconfig files #6700

rm3l opened this issue Mar 30, 2023 · 4 comments · Fixed by #7017
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/Medium Nice to have issue. Getting it done before priority changes would be great.
Milestone

Comments

@rm3l
Copy link
Member

rm3l commented Mar 30, 2023

/kind bug

What versions of software are you using?

Operating System:
Fedora 37

Output of odo version:
odo v3.8.0 (cb5d20d)

How did you run odo exactly?

I recently set my local KUBECONFIG environment variable set to a list of kubeconfig files, to separate the different clusters that I have.

KUBECONFIG=/home/asoro/.kube/config:/home/asoro/work/projects/odo/.ci_kubeconfig odo list

Actual behavior

$ KUBECONFIG=/home/asoro/.kube/config:/home/asoro/work/projects/odo/.ci_kubeconfig odo list
 ✗  KUBECONFIG not found. Unable to retrieve cluster information. Please set your Kubernetes configuration via KUBECONFIG env variable or ~/.kube/config

Expected behavior

The KUBECONFIG environment variable can be a list of separate kubeconfig files, which is valid per the official doc. This list is colon-delimited on Linux and Max, and semicolon-delimited on Windows.
So odo list should work and use the result of merging the files listed in KUBECONFIG.

Any logs, error output, etc?

odo list seems to handle this environment variable differently. Other commands, like odo dev, odo describe component, ... work fine with the same KUBECONFIG env var.

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Mar 30, 2023
@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/*` and requires one. label Mar 30, 2023
@rm3l
Copy link
Member Author

rm3l commented Mar 30, 2023

I actually noticed this issue via the OpenShift Toolkit plugin for JetBrains IDEs:

image

Below is the complete stack trace of the plugin:

Plugin stack trace
java.io.IOException: Process exited with an error: 1 (Exit value: 1) {
	"message": "KUBECONFIG not found. Unable to retrieve cluster information. Please set your Kubernetes configuration via KUBECONFIG env variable or ~/.kube/config"
}

	at com.redhat.devtools.intellij.common.utils.ExecHelper.executeWithResult(ExecHelper.java:261)
	at org.jboss.tools.intellij.openshift.utils.odo.OdoCli.execute(OdoCli.java:244)
	at org.jboss.tools.intellij.openshift.utils.odo.OdoCli.discover(OdoCli.java:856)
	at org.jboss.tools.intellij.openshift.utils.odo.OdoProjectDecorator.discover(OdoProjectDecorator.java:263)
	at org.jboss.tools.intellij.openshift.tree.application.ApplicationsRootNode.addContext(ApplicationsRootNode.java:138)
	at org.jboss.tools.intellij.openshift.tree.application.ApplicationsRootNode.loadProjectModel(ApplicationsRootNode.java:109)
	at org.jboss.tools.intellij.openshift.tree.application.ApplicationsRootNode.lambda$initializeOdo$0(ApplicationsRootNode.java:83)
	at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863)
	at java.base/java.util.concurrent.CompletableFuture.uniWhenCompleteStage(CompletableFuture.java:887)
	at java.base/java.util.concurrent.CompletableFuture.whenComplete(CompletableFuture.java:2325)
	at org.jboss.tools.intellij.openshift.tree.application.ApplicationsRootNode.initializeOdo(ApplicationsRootNode.java:78)
	at org.jboss.tools.intellij.openshift.tree.application.ApplicationsTreeStructure.getApplicationsRoot(ApplicationsTreeStructure.java:87)
	at org.jboss.tools.intellij.openshift.tree.application.ApplicationsTreeStructure.getChildElements(ApplicationsTreeStructure.java:99)
	at com.intellij.ui.tree.StructureTreeModel.getValidChildren(StructureTreeModel.java:412)
	at com.intellij.ui.tree.StructureTreeModel.validateChildren(StructureTreeModel.java:330)
	at com.intellij.ui.tree.StructureTreeModel.getNode(StructureTreeModel.java:324)
	at com.intellij.ui.tree.StructureTreeModel.getChildren(StructureTreeModel.java:344)
	at com.intellij.ui.tree.AsyncTreeModel$CmdGetChildren.getNode(AsyncTreeModel.java:548)
	at com.intellij.ui.tree.AsyncTreeModel$Command.get(AsyncTreeModel.java:443)
	at com.intellij.ui.tree.AsyncTreeModel$Command.get(AsyncTreeModel.java:409)
	at com.intellij.util.concurrency.Invoker$Task.run(Invoker.java:305)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1111)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runInReadActionWithWriteActionPriority$0(ProgressIndicatorUtils.java:71)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtilService.runActionAndCancelBeforeWrite(ProgressIndicatorUtilService.java:63)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:128)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runWithWriteActionPriority$1(ProgressIndicatorUtils.java:109)
	at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:68)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173)
	at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:68)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:106)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:71)
	at com.intellij.util.concurrency.Invoker.invokeSafely(Invoker.java:187)
	at com.intellij.util.concurrency.Invoker.lambda$offerSafely$0(Invoker.java:165)
	at com.intellij.util.concurrency.Invoker$Background.lambda$offer$0(Invoker.java:475)
	at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:243)
	at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:29)
	at com.intellij.util.concurrency.BoundedTaskExecutor$1.executeFirstTaskAndHelpQueue(BoundedTaskExecutor.java:216)
	at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:212)
	at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:205)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
	at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
	at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
	at com.redhat.devtools.intellij.common.utils.ExecHelper.executeWithResult(ExecHelper.java:258)
	... 51 more

@rm3l rm3l changed the title odo list does not work if KUBECONFIG env var is a colon-delimited list of kubeconfig files odo list does not work if KUBECONFIG env var points to multiple kubeconfig files Mar 30, 2023
@kadel kadel added the priority/Medium Nice to have issue. Getting it done before priority changes would be great. label Apr 3, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jul 3, 2023

A friendly reminder that this issue had no activity for 90 days. Stale issues will be closed after an additional 30 days of inactivity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 3, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2023

This issue was closed because it has been inactive for 30 days since being marked as stale.

@github-actions github-actions bot added the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Aug 3, 2023
@github-actions github-actions bot closed this as completed Aug 3, 2023
@github-project-automation github-project-automation bot moved this to Done ✅ in odo Project Aug 3, 2023
@rm3l
Copy link
Member Author

rm3l commented Aug 3, 2023

/reopen
/remove-lifecycle rotten
/remove-lifecycle stale

Reopening as it is still relevant to me to make odo list work consistently in this case. All the other commands work correctly.

@rm3l rm3l reopened this Aug 3, 2023
@github-project-automation github-project-automation bot moved this from Done ✅ to To Do 📝 in odo Project Aug 3, 2023
@openshift-ci openshift-ci bot removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Aug 3, 2023
@rm3l rm3l removed the needs-triage Indicates an issue or PR lacks a `triage/*` and requires one. label Aug 3, 2023
@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/*` and requires one. label Aug 3, 2023
@rm3l rm3l removed the status in odo Project Aug 3, 2023
@rm3l rm3l mentioned this issue Aug 3, 2023
3 tasks
@rm3l rm3l added this to the v3.14.0 🚀 milestone Aug 3, 2023
@rm3l rm3l removed the needs-triage Indicates an issue or PR lacks a `triage/*` and requires one. label Aug 3, 2023
@feloy feloy moved this to In Review 👀 in odo Project Aug 3, 2023
@github-project-automation github-project-automation bot moved this from In Review 👀 to Done ✅ in odo Project Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/Medium Nice to have issue. Getting it done before priority changes would be great.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants