Bug 2002950

Summary: Why spec.containers.command is not created with "oc create deploymentconfig <dc-name> --image=<image> -- <command>"
Product: OpenShift Container Platform Reporter: ryoji noma <rnoma>
Component: ocAssignee: Maciej Szulik <maszulik>
oc sub component: oc QA Contact: zhou ying <yinzhou>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: aos-bugs, dapark, mfojtik
Version: 4.6   
Target Milestone: ---   
Target Release: 4.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-11 18:15:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description ryoji noma 2021-09-10 08:07:14 UTC
Description of problem:
The spec.containers.command is not created with "oc create deploymentconfig <dc-name> --image=<image> -- <command>".The <command> are specified in spec.containers.args. 

Version-Release number of selected component (if applicable):

OpenShift4.6

How reproducible:

Create deploymentconfig with the following command.

```
$ oc create deploymentconfig testdeployer-from-dc --image=ubi8/ubi -- tail -f /dev/null
...
spec:
  containers:
  - args:
    - tail
    - -f
    - /dev/null
    image: ubi8/ubi
```

If using deployment, the spec.containers.command is created.

```
$oc create deployment testdeployer-from-deploy --image=ubi8/ubi -- tail -f /dev/null
...
spec:
  containers:
  - command:
    - tail
    - -f
    - /dev/null
    image: ubi8/ubi
```

Both pods were created without any problems.

```
$ oc  get pod 
NAME                                        READY   STATUS      RESTARTS   AGE
testdeployer-from-dc-1-2kc55                1/1     Running     0          15m
testdeployer-from-dc-1-deploy               0/1     Completed   0          15m
testdeployer-from-deploy-77749684d8-klrmj   1/1     Running     0          17m
```

Actual results:

The spec.containers.command is not created.
 
Expected results:

The spec.containers.command should be created.

Comment 2 zhou ying 2021-09-16 05:16:37 UTC
Confirmed with latest oc , can't reproduce the issue now:
[root@localhost ~]#  oc create deploymentconfig testdeployer-from-dc --image=ubi8/ubi -- tail -f /dev/null
deploymentconfig.apps.openshift.io/testdeployer-from-dc created
[root@localhost ~]# oc get dc 
NAME                   REVISION   DESIRED   CURRENT   TRIGGERED BY
testdc                 1          1         1         config
testdeployer-from-dc   1          1         1         config
[root@localhost ~]# oc get dc testdeployer-from-dc -o yaml 
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
  creationTimestamp: "2021-09-16T05:14:51Z"
  generation: 1
  name: testdeployer-from-dc
  namespace: zhou
  resourceVersion: "42894"
  uid: a377fe7c-13ae-4a49-a080-5e5ebfc0e115
spec:
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    deployment-config.name: testdeployer-from-dc
  strategy:
    activeDeadlineSeconds: 21600
    resources: {}
    rollingParams:
      intervalSeconds: 1
      maxSurge: 25%
      maxUnavailable: 25%
      timeoutSeconds: 600
      updatePeriodSeconds: 1
    type: Rolling
  template:
    metadata:
      creationTimestamp: null
      labels:
        deployment-config.name: testdeployer-from-dc
    spec:
      containers:
      - command:
        - tail
        - -f
        - /dev/null
        image: ubi8/ubi
        imagePullPolicy: Always
        name: default-container
        resources: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
  test: false
  triggers:
  - type: ConfigChange