Zun

Convert type of 'command' from string to list

Bug #1755019 reported by hongbin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zun
Fix Released
Medium
Rajat Sharma

Bug Description

Zun is currently using a string representation of 'command', but Docker is returning 'Cmd' in string representation. This requires a conversion of commands between list and string, which is complicated and error-prone (it might causes bugs like https://review.openstack.org/#/c/551795/).

It is better to switch from string to list. In particular, this includes:

* DB model (zun/db/sqlalchemy/models.py): store 'command' as list instead of string
* API (zun/api/validation/parameter_types.py): convert the 'command' parameter from string to list (this requires a micro-version bump. see here: https://docs.openstack.org/zun/latest/contributor/api-microversion.html).
* Driver (zun/container/docker/driver.py): On creating container, pass the list representation of 'command' to docker (docker supports both list and string 'command' in container_create https://docker-py.readthedocs.io/en/stable/api.html#docker.api.container.ContainerApiMixin.create_container).

hongbin (hongbin034)
Changed in zun:
importance: Undecided → Medium
status: New → Triaged
Changed in zun:
assignee: nobody → Deepak Mourya (mourya007)
Changed in zun:
assignee: Deepak Mourya (mourya007) → nobody
Revision history for this message
Deepak Mourya (mourya007) wrote :

Hi, for microversion bump here you mean adding something like @base.Controller.api_version("1.2", "1.3") to determine api modification .

Revision history for this message
hongbin (hongbin034) wrote :

Yes and no. First, this is a change of method's behavior, so make sure doing this:

  https://docs.openstack.org/zun/latest/contributor/api-microversion.html#changing-a-method-s-behavior

In addition, there are other necessary changes:

  https://docs.openstack.org/zun/latest/contributor/api-microversion.html#other-necessary-changes

Rajat Sharma (tajar29)
Changed in zun:
assignee: nobody → Rajat Sharma (tajar29)
Revision history for this message
hongbin (hongbin034) wrote :

Unassigned due to no activity since 2018-03-20

Changed in zun:
assignee: Rajat Sharma (tajar29) → nobody
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to zun (master)

Fix proposed to branch: master
Review: https://review.openstack.org/575709

Changed in zun:
assignee: nobody → Rajat Sharma (tajar29)
status: Triaged → In Progress
Changed in zun:
assignee: Rajat Sharma (tajar29) → hongbin (hongbin034)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to zun (master)

Reviewed: https://review.openstack.org/575709
Committed: https://git.openstack.org/cgit/openstack/zun/commit/?id=b03fbe6dfddea496bc156ee45c44f972d4ebd580
Submitter: Zuul
Branch: master

commit b03fbe6dfddea496bc156ee45c44f972d4ebd580
Author: rajat29 <email address hidden>
Date: Fri Jun 15 14:50:48 2018 +0530

    Convert type of 'command' from string to list

    Zun is currently using a string representation of 'command',
    but Docker is returning 'Cmd' in string representation. This
    requires a conversion of commands between list and string,
    which is complicated and error-prone (it might causes bugs like
    https://review.openstack.org/#/c/551795/).
    It is better to switch from string to list

    Co-Authored-By: Hongbin Lu <email address hidden>

    Change-Id: Ie0df504a67cc20907d35e3513fd80d3f6be687fd
    Closes-Bug: #1755019

Changed in zun:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to zun (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/580253

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to zun (master)

Reviewed: https://review.openstack.org/580253
Committed: https://git.openstack.org/cgit/openstack/zun/commit/?id=aafdd20617e882620f956a2c7cac3c67343cf690
Submitter: Zuul
Branch: master

commit aafdd20617e882620f956a2c7cac3c67343cf690
Author: Hongbin Lu <email address hidden>
Date: Thu Jul 5 02:43:02 2018 +0000

    capsule: convert 'command' from string to list

    Change-Id: I644f7488190e11205ce958d8b79c9541a7ea10ec
    Related-Bug: #1755019

hongbin (hongbin034)
Changed in zun:
assignee: hongbin (hongbin034) → Rajat Sharma (tajar29)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/zun 2.0.0

This issue was fixed in the openstack/zun 2.0.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.