oc create fails to run due to: only encoded map or array can be decoded into a struct

Solution Verified - Updated -

Issue

Commands like oc create -f test.yml fail with an error similar to:

Error from server (BadRequest): error when creating "test.yml": Service in version "v1" cannot be handled as a Service: only encoded map or array can be decoded into a struct

Environment

  • Red Hat OpenShift Container Platform 3.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.