The `oc apply` command is failing with "cannot use generate name with apply" or "resource name may not be empty" error.

Solution Verified - Updated -

Issue

  • The oc apply command fails with below error:
In OCP 4.5:
resource name may not be empty
In OCP 4.6:
cannot use generate name with apply

Environment

  • Red Hat OpenShift Container Platform
    • 4.5
    • 4.6

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