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, 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