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 logs panics if there is no Kubeconfig #6555

Closed
rm3l opened this issue Jan 31, 2023 · 0 comments · Fixed by #6561
Closed

odo logs panics if there is no Kubeconfig #6555

rm3l opened this issue Jan 31, 2023 · 0 comments · Fixed by #6561
Assignees
Labels
area/log Issues or PRs related to `odo logs` kind/bug Categorizes issue or PR as related to a bug.
Milestone

Comments

@rm3l
Copy link
Member

rm3l commented Jan 31, 2023

/kind bug

What versions of software are you using?

Operating System:
Fedora 37, kernel 6.1.7-200.fc37.x86_64

Output of odo version:
odo v3.6.0 (4c14a74)

How did you run odo exactly?

From a component directory (i.e. with a devfile.yaml):

KUBECONFIG=/dev/null odo logs

Actual behavior

$ KUBECONFIG=/dev/null odo logs

panic: GetNamespace can be called only when clientset.KUBERNETES is added to dependencies

goroutine 1 [running]:
github.com/redhat-developer/odo/pkg/odo/context.GetNamespace({0x3561a58?, 0xc000894090?})
        /home/asoro/work/projects/odo/pkg/odo/context/kubernetes.go:26 +0x65
github.com/redhat-developer/odo/pkg/odo/cli/logs.(*LogsOptions).Run(0xc000341b20, {0x3561a58, 0xc000894090})
        /home/asoro/work/projects/odo/pkg/odo/cli/logs/logs.go:123 +0x11a
github.com/redhat-developer/odo/pkg/odo/genericclioptions.GenericRun({0x3562660, 0xc000341b20}, 0xc0005e2c80, {0x4904d08, 0x0, 0x0})
        /home/asoro/work/projects/odo/pkg/odo/genericclioptions/runnable.go:282 +0x1659
github.com/redhat-developer/odo/pkg/odo/cli/logs.NewCmdLogs.func1(0xc0005e2c80?, {0x4904d08?, 0x0?, 0x0?})
        /home/asoro/work/projects/odo/pkg/odo/cli/logs/logs.go:239 +0x38
github.com/spf13/cobra.(*Command).execute(0xc0005e2c80, {0x4904d08, 0x0, 0x0})
        /home/asoro/work/projects/odo/vendor/github.com/spf13/cobra/command.go:872 +0x694
github.com/spf13/cobra.(*Command).ExecuteC(0xc0005ae780)
        /home/asoro/work/projects/odo/vendor/github.com/spf13/cobra/command.go:990 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
        /home/asoro/work/projects/odo/vendor/github.com/spf13/cobra/command.go:918
github.com/spf13/cobra.(*Command).ExecuteContext(...)
        /home/asoro/work/projects/odo/vendor/github.com/spf13/cobra/command.go:911
main.main()
        /home/asoro/work/projects/odo/cmd/odo/odo.go:83 +0x579

Expected behavior

We should not panic, but return a nicer error message.

Any logs, error output, etc?

@rm3l rm3l added the area/log Issues or PRs related to `odo logs` label Jan 31, 2023
@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Jan 31, 2023
@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/*` and requires one. label Jan 31, 2023
@rm3l rm3l added this to odo Project Jan 31, 2023
@rm3l rm3l mentioned this issue Jan 31, 2023
3 tasks
@feloy feloy self-assigned this Feb 1, 2023
@feloy feloy removed the needs-triage Indicates an issue or PR lacks a `triage/*` and requires one. label Feb 1, 2023
@feloy feloy moved this to In Progress 🚧 in odo Project Feb 1, 2023
@github-project-automation github-project-automation bot moved this from In Progress 🚧 to Done ✅ in odo Project Feb 6, 2023
@rm3l rm3l added this to the v3.7.0 🚀 milestone Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/log Issues or PRs related to `odo logs` kind/bug Categorizes issue or PR as related to a bug.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants