You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Output of odo version:
odo v3.0.0-alpha1 (b7e45da)
How did you run odo exactly?
❯ odo dev --kubeconfig /path/to/a/kubeconfig/other/than/the/default
This always uses the default config, not the one specified by the user. As such, it uses the wrong cluster.
Actually, this affects all commands that expose this flag, like odo deploy or odo list, e.g.:
❯ odo list --kubeconfig /path/to/a/kubeconfig/other/than/the/default -v 4
I0511 16:41:56.599645 1765751 implem.go:103] The path for preference file is /home/asoro/.config/odo/preferences.yaml
I0511 16:41:56.599700 1765751 util.go:733] HTTPGetRequest: https://raw.githubusercontent.com/redhat-developer/odo/main/build/VERSION
I0511 16:41:56.599724 1765751 segment.go:254] Checking telemetry enable status
I0511 16:41:56.599767 1765751 util.go:754] Response will be cached in /tmp/odohttpcache for 1h0m0s
I0511 16:41:56.602227 1765751 util.go:1077] using default kubeconfig path /home/asoro/.kube/config
--- truncated ---
Actual behavior
Almost all commands currently expose this --kubeconfig flag in their help message (under the "Additional Flags" section):
For example, with odo help dev:
Additional Flags:
--kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster.
-v, --v Level Number for the log level verbosity. Level varies from 0 to 9 (default 0).
--vmodule moduleSpec Comma-separated list of pattern=N settings for file-filtered logging
Maybe I missed something, but I was expecting this --kubeconfig option to allow me to target a different cluster. Instead, it seems like odo always reads the default ${HOME}/.kube/config file.
// Check to see if KUBECONFIG exists, and if not, error the user that we would not be able to get cluster information
// Do this before anything else, or else we will just error out with the:
// invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable
// instead
if!dfutil.CheckKubeConfigExist() {
returnerrors.New("KUBECONFIG not found. Unable to retrieve cluster information. Please set your Kubernetes configuration via KUBECONFIG env variable or ~/.kube/config")
}
Expected behavior
Make odo honor the user-defined kubeconfig file(s) defined via this flag, for all interactions with a cluster.
Workaround: Set the KUBECONFIG environment variable instead, but it would be nice to make this --kubeconfig option work (taking precedence over the environment variable).
Or if this is not something expected, we should probably remove this flag from the Help messages.
The text was updated successfully, but these errors were encountered:
/kind bug
What versions of software are you using?
Operating System:
Fedora release 36 (Thirty Six)
Output of
odo version
:odo v3.0.0-alpha1 (b7e45da)
How did you run odo exactly?
This always uses the default config, not the one specified by the user. As such, it uses the wrong cluster.
Actually, this affects all commands that expose this flag, like
odo deploy
orodo list
, e.g.:Actual behavior
Almost all commands currently expose this
--kubeconfig
flag in their help message (under the "Additional Flags" section):For example, with
odo help dev
:Maybe I missed something, but I was expecting this
--kubeconfig
option to allow me to target a different cluster. Instead, it seems likeodo
always reads the default${HOME}/.kube/config
file.After a quick look, it looks like:
kclient
with the defaults:odo/pkg/kclient/kclient.go
Lines 70 to 73 in b7e45da
odo list
, we always check either theKUBECONFIG
env var is set or the default~/.kube/config
does exist :odo/pkg/odo/cli/list/list.go
Lines 69 to 75 in b7e45da
Expected behavior
Make
odo
honor the user-definedkubeconfig
file(s) defined via this flag, for all interactions with a cluster.Workaround: Set the
KUBECONFIG
environment variable instead, but it would be nice to make this--kubeconfig
option work (taking precedence over the environment variable).Or if this is not something expected, we should probably remove this flag from the Help messages.
The text was updated successfully, but these errors were encountered: