-
Notifications
You must be signed in to change notification settings - Fork 979
Closed
Labels
sig/cliCategorizes an issue or PR as relevant to SIG CLI.Categorizes an issue or PR as relevant to SIG CLI.
Description
The kubectl patch
command currently fails when there is no kubeconfig present, no --config
flag is provided, and --local
is given:
# ensure no kubeconfig exists
$ rm ~/.kube/config
# run patch without hitting the server
$ kubectl patch /path/to/obj.yaml --local --type=json -o json
error: Missing or incomplete configuration info. Please login or point to an existing, complete config file:
1. Via the command-line flag --config
2. Via the KUBECONFIG environment variable
3. In your home directory as ~/.kube/config
To view or setup config directly use the 'config' command.
Since we are not hitting the server, no kubeconfig should be needed.
This error occurs here when attempting to retrieve a namespace in the command's Complete method.
We should be looking up the namespace much later in the command, and only if not running as --local
.
We could consider adding a NamespaceFunc
field to the command's options struct that is called when needed in the Run method.
Metadata
Metadata
Assignees
Labels
sig/cliCategorizes an issue or PR as relevant to SIG CLI.Categorizes an issue or PR as relevant to SIG CLI.