Error when trying to prune images in OpenShift: "You must use a client config with a token"

Solution Verified - Updated -

Issue

  • In OpenShift Container Platform 3.x, while pruning images using the system:admin user, the following error occurs:

    # oc adm prune images --confirm=true
    error: You must use a client config with a token
    
  • In OpenShift Container Platform 4.x, while pruning images using the system:admin user or the kubeconfig file that 4.x installation provides, the following error occurs:

    # oc adm prune images --confirm=true
    error: You must use a client config with a token
    

Environment

  • Red Hat OpenShift Container Platform (OCP)
    • 3.x
    • 4.x

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