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 deploy panics if there is no Kubeconfig #6694

Closed
rm3l opened this issue Mar 28, 2023 · 1 comment · Fixed by #6688
Closed

odo deploy panics if there is no Kubeconfig #6694

rm3l opened this issue Mar 28, 2023 · 1 comment · Fixed by #6688
Labels
area/deploy Issues or PRs specific to the `odo deploy` command kind/bug Categorizes issue or PR as related to a bug.
Milestone

Comments

@rm3l
Copy link
Member

rm3l commented Mar 28, 2023

/kind bug
/area deploy

What versions of software are you using?

Operating System:
Fedora 37

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

How did you run odo exactly?

mkdir /tmp/bug-odo-deploy
cd /tmp/bug-odo-deploy

odo init --name bug-odo-deploy --devfile go --devfile-version 2.0.0

KUBECONFIG=/dev/null odo deploy

Actual behavior

$ KUBECONFIG=/dev/null odo deploy                
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({0x380ba18?, 0xc000b8e480?})
        /home/asoro/work/projects/odo/pkg/odo/context/kubernetes.go:26 +0x65
github.com/redhat-developer/odo/pkg/odo/cli/deploy.(*DeployOptions).Run(0xc0000155d0, {0x380ba18, 0xc000b8e480})
        /home/asoro/work/projects/odo/pkg/odo/cli/deploy/deploy.go:76 +0x8e
github.com/redhat-developer/odo/pkg/odo/genericclioptions.GenericRun({0x380c5b0, 0xc0000155d0}, 0xc00049c600, {0x4ccbe68, 0x0, 0x0})
        /home/asoro/work/projects/odo/pkg/odo/genericclioptions/runnable.go:282 +0x1659
github.com/redhat-developer/odo/pkg/odo/cli/deploy.NewCmdDeploy.func1(0xc00049c600?, {0x4ccbe68?, 0x0?, 0x0?})
        /home/asoro/work/projects/odo/pkg/odo/cli/deploy/deploy.go:108 +0x38
github.com/spf13/cobra.(*Command).execute(0xc00049c600, {0x4ccbe68, 0x0, 0x0})
        /home/asoro/work/projects/odo/vendor/github.com/spf13/cobra/command.go:916 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0xc00084e000)
        /home/asoro/work/projects/odo/vendor/github.com/spf13/cobra/command.go:1044 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
        /home/asoro/work/projects/odo/vendor/github.com/spf13/cobra/command.go:968
github.com/spf13/cobra.(*Command).ExecuteContext(...)
        /home/asoro/work/projects/odo/vendor/github.com/spf13/cobra/command.go:961
main.main()
        /home/asoro/work/projects/odo/cmd/odo/odo.go:83 +0x585

Expected behavior

It should not panic but return a nicer error message.

Any logs, error output, etc?

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

rm3l commented Mar 28, 2023

This should be fixed with #6688, which has a similar issue at command validation time.

@rm3l rm3l linked a pull request Mar 28, 2023 that will close this issue
3 tasks
@rm3l rm3l removed the needs-triage Indicates an issue or PR lacks a `triage/*` and requires one. label Mar 28, 2023
@rm3l rm3l added this to the v3.9.0 🚀 milestone Mar 28, 2023
@github-project-automation github-project-automation bot moved this to Done ✅ in odo Project Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/deploy Issues or PRs specific to the `odo deploy` command 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.

1 participant