Bug 2002950 - Why spec.containers.command is not created with "oc create deploymentconfig <dc-name> --image=<image> -- <command>"
Summary: Why spec.containers.command is not created with "oc create deploymentconfig <...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.6
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.10.0
Assignee: Maciej Szulik
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-09-10 08:07 UTC by ryoji noma
Modified: 2022-03-11 18:15 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-03-11 18:15:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc pull 925 0 None open Bug 2002950: Define a Command instead of Arguments for Container 2021-09-13 06:08:48 UTC

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


Note You need to log in before you can comment on or make changes to this bug.