oc command fails due to the corrupted kubeconfig​​ even though the --token option is specified

Solution Verified - Updated -

Issue

  • When running oc command with the --token option fails with the message:
$ oc --token=${TOKEN} whoami
error loading config file ".kube/config": yaml: line 10: could not find expected ':'
  • Why does the command fail even though using token instead of kubeconfig?

Environment

  • Red Hat OpenShift Container Platform
    • 4

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content