Skip to content

kubectl get nodes -show-labels json parse error #94030

Closed

Description

@corburn

What happened:
I forgot to use a double dash for the flag: --show-labels

kubectl get nodes -show-labels
error: couldn't get version/kind; json parse error: json: cannot unmarshal string into Go value of type struct { APIVersion string "json:\"apiVersion,omitempty\""; Kind string "json:\"kind,omitempty\"" }

What you expected to happen:
I expected to see an error such as Error: unknown flag -show-labels instead of a JSON parse error.

How to reproduce it (as minimally and precisely as possible):
Run kubectl get nodes -show-labels

Anything else we need to know?:

Environment:

  • Kubernetes version (use kubectl version):
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.6", GitCommit:"dff82dc0de47299ab66c83c626e08b245ab19037", GitTreeState:"clean", BuildDate:"2020-07-15T16:58:53Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.6", GitCommit:"dff82dc0de47299ab66c83c626e08b245ab19037", GitTreeState:"clean", BuildDate:"2020-07-15T16:51:04Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}
  • Cloud provider or hardware configuration: Dell XPS 13 9300
  • OS (e.g: cat /etc/os-release): Windows 10 WSL 2 (Ubuntu 20.04.1 LTS)
  • Kernel (e.g. uname -a): 4.19.104-microsoft-standard
  • Install tools: Docker Desktop with Kubernetes and WSL 2 enabled
  • Network plugin and version (if this is a network-related bug):
  • Others:

Activity

  1. added
    kind/bugCategorizes issue or PR as related to a bug.
    on Aug 15, 2020
  2. added
    needs-sigIndicates an issue or PR lacks a `sig/foo` label and requires one.
    on Aug 15, 2020
  3. corburn commented on Aug 15, 2020

    @corburn
    Author

    /sig cli

  4. added
    sig/cliCategorizes an issue or PR as relevant to SIG CLI.
    and removed
    needs-sigIndicates an issue or PR lacks a `sig/foo` label and requires one.
    on Aug 15, 2020
  5. removed their assignment
    on Aug 16, 2020
  6. odinuge commented on Aug 16, 2020

    @odinuge
    Member

    Hey! This is intended behavior since it matches the -s flag with how-labels as the value. The docs says; -s, --server='': The address and port of the Kubernetes API server. You can find these global flags by using kubectl options.

    /close

  7. k8s-ci-robot commented on Aug 16, 2020

    @k8s-ci-robot
    Contributor

    @odinuge: Closing this issue.

    Details

    In response to this:

    Hey! This is intended behavior since it matches the -s flag with how-labels as the value. The docs says; -s, --server='': The address and port of the Kubernetes API server. You can find these global flags by using kubectl options.

    /close

    Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.sig/cliCategorizes an issue or PR as relevant to SIG CLI.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions