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

config file /home/user/.kube/config does not use quotation marks #93

Open
skyox opened this issue Sep 8, 2021 · 0 comments
Open

config file /home/user/.kube/config does not use quotation marks #93

skyox opened this issue Sep 8, 2021 · 0 comments

Comments

@skyox
Copy link

skyox commented Sep 8, 2021

Describe the bug

We use the mobile phone number as the username, but the generated kubeconfig does not use quotation marks, resulting in an error when using the oc command

bash-4.4 ~ $ cat /home/user/.kube/config 
apiVersion: v1
clusters:
- cluster:
    certificate-authority: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
    server: https://172.30.0.1:443
  name: https://172.30.0.1:443
users:
- name: 18656157120
  user:
    token: sha256~F696KTgtysnKT-U9yjUZ2mTreR2Sc8EFTuOKMSJIEik
contexts:
- context:
    cluster: https://172.30.0.1:443
    namespace: tool-polaris
    user: 18656157120
  name: 18656157120-context
current-context: 18656157120-context
kind: Config

bash-4.4 ~ $ oc get pod
error: error loading config file "/home/user/.kube/config": v1.Config.Contexts: []v1.NamedContext: v1.NamedContext.Context: v1.Context.AuthInfo: ReadString: expects " or n, but found 1, error found in #10 byte of ...|","user":18656157120|..., bigger context ...|72.30.0.1:443","namespace":"tool-polaris","user":18656157120},"name":"18656157120-context"}],"curren|...

Environment

  • Web Terminal: v1.2.1
  • OpenShift Version: 4.8

When I add quotation marks, the oc command can be executed normally

bash-4.4 ~ $ cat /home/user/.kube/config 
...
users:
- name: "18656157120"
  user:
    token: sha256~F696KTgtysnKT-U9yjUZ2mTreR2Sc8EFTuOKMSJIEik
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant