"oc set env" command does not work as expected in RHOCP4

Solution Verified - Updated -

Issue

  • The oc set env command changes apiVersion for Route and DeploymentConfig.

  • The OC client version 4.10 returns the expected output:

$ oc set env -e FOO="BAR" -f process.json --local -o json
{
    "kind": "Route",
    "apiVersion": "route.openshift.io/v1",
    "metadata": {
        "name": "test"
.....
.....
    "kind": "DeploymentConfig",
    "apiVersion": "apps.openshift.io/v1",
  • However, the OC client version for 4.12, 4.13 and 4.14 changes the apiVersion for Route and DeploymentConfig:
$ oc set env -e FOO="BAR" -f process.json --local -o json
{
    "kind": "Route",
    "apiVersion": "v1",
    "metadata": {
        "name": "test"
.....
.....
    "kind": "DeploymentConfig",
    "apiVersion": "v1",

Environment

  • Red Hat OpenShift Container Platform (RHOCP)
    • 4.12+

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