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

"kubectl config set" hangs and panics when trying to set user fields #29312

Closed
ericchiang opened this issue Jul 20, 2016 · 5 comments
Closed
Assignees
Labels
area/kubectl priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.

Comments

@ericchiang
Copy link
Contributor

Trying to set some values in a kubeconfig related to the client auth provider added in #23066.

Here's my current attempt.

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"3+", GitVersion:"v1.3.3-beta.0+$Format:%h$", GitCommit:"$Format:%H$", GitTreeState:"not a git tree", BuildDate:"1970-01-01T00:00:00Z", GoVersion:"go1.7beta2", Compiler:"gc", Platform:"linux/amd64"}
The connection to the server localhost:8080 was refused - did you specify the right host or port?
$ kubectl config set-credentials me
user "me" set.
$ kubectl config view
apiVersion: v1
clusters: []
contexts: []
current-context: ""
kind: Config
preferences: {}
users:
- name: me
  user: {}
$ kubectl config set users.[0].user.auth-provider.name oidc
^C # hangs forever
$ kubectl config set users.me.user.auth-provider.name oidc
^C # hangs forever
$ kubectl config set users.user.auth-provider.name oidc
^C # hangs forever
$ kubectl config set users.user.auth-provider oidc
panic: unrecognized type: <nil>

goroutine 1 [running]:
panic(0x13d0d80, 0xc4203d1c60)
    /usr/local/go/src/runtime/panic.go:500 +0x1a1
k8s.io/kubernetes/pkg/kubectl/cmd/config.modifyConfig(0xc42017e600, 0xc4200c6af0, 0x16, 0xc4200e65c0, 0x7ffd45e83d35, 0x4, 0x0, 0x1336de0, 0x131a35a)
    /home/eric/src/k8s.io/kubernetes/pkg/kubectl/cmd/config/set.go:245 +0x819
k8s.io/kubernetes/pkg/kubectl/cmd/config.modifyConfig(0x1336da0, 0xc4200c6a50, 0x16, 0xc4200e65c0, 0x7ffd45e83d35, 0x4, 0x1330000, 0xc4200c6a50, 0x16)
    /home/eric/src/k8s.io/kubernetes/pkg/kubectl/cmd/config/set.go:237 +0x3aa
k8s.io/kubernetes/pkg/kubectl/cmd/config.modifyConfig(0x134c920, 0xc4200960f8, 0x16, 0xc4200e65c0, 0x7ffd45e83d35, 0x4, 0x0, 0x13ff440, 0x12f304c)
    /home/eric/src/k8s.io/kubernetes/pkg/kubectl/cmd/config/set.go:161 +0x1885
k8s.io/kubernetes/pkg/kubectl/cmd/config.modifyConfig(0x1434f60, 0xc4200960c0, 0x16, 0xc4200e65c0, 0x7ffd45e83d35, 0x4, 0xc4203d0000, 0x136b940, 0xc4203d0b7b)
    /home/eric/src/k8s.io/kubernetes/pkg/kubectl/cmd/config/set.go:237 +0x3aa
k8s.io/kubernetes/pkg/kubectl/cmd/config.setOptions.run(0x1f8cc00, 0xc4200a0730, 0x7ffd45e83d1c, 0x18, 0x7ffd45e83d35, 0x4, 0x0, 0x136b940, 0xc4203d0b7b)
    /home/eric/src/k8s.io/kubernetes/pkg/kubectl/cmd/config/set.go:95 +0x1a0
k8s.io/kubernetes/pkg/kubectl/cmd/config.NewCmdConfigSet.func1(0xc42018e800, 0xc42023fbe0, 0x2, 0x2)
    /home/eric/src/k8s.io/kubernetes/pkg/kubectl/cmd/config/set.go:61 +0x9a
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).execute(0xc42018e800, 0xc42023f6a0, 0x2, 0x2, 0xc42018e800, 0xc42023f6a0)
    /home/eric/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:565 +0x411
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc4200ba200, 0xc4203d0a20, 0x1, 0x1)
    /home/eric/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:651 +0x367
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).Execute(0xc4200ba200, 0x1f7e060, 0xc420036008)
    /home/eric/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:610 +0x2b
k8s.io/kubernetes/cmd/kubectl/app.Run(0x4, 0x4)
    /home/eric/src/k8s.io/kubernetes/cmd/kubectl/app/kubectl.go:32 +0x94
main.main()
    /home/eric/src/k8s.io/kubernetes/cmd/kubectl/kubectl.go:28 +0x32
@ericchiang
Copy link
Contributor Author

@kubernetes/kubectl

@pwittrock
Copy link
Member

@adohe Would you take a look at this?

@pwittrock pwittrock added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Jul 21, 2016
@adohe-zz
Copy link

@pwittrock I will take a look today.

k8s-github-robot pushed a commit that referenced this issue Aug 6, 2016
…als-auth-providers

Automatic merge from submit-queue

kubectl config set-crentials: add arguments for auth providers

This PR adds `--auth-provider` and `--auth-provider-arg` flags to the
`kubectl config set-credentials` sub-command.

There's currently no way of interacting with the new auth provider framework added in #23066 through kubectl. You have to render a custom kubeconfig to use them. Additionally `kubectl config set` just sort of craps out when attempting to interact with authentication info objects (#29312).

This is a minimal implementation of allowing `kubect config set-credentials` to set fields for client auth providers.

cc @cjcullen @kubernetes/kubectl
@pwittrock
Copy link
Member

@adohe Is this still relevant?

@adohe-zz
Copy link

@pwittrock I believe we can close this now, #30007 is merged already. Thanks @ericchiang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubectl priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
Development

No branches or pull requests

4 participants