Zun

Container name having space and special characters should be disallowed, current regular expression is wrong

Bug #1640680 reported by Pradeep Kumar Singh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zun
Fix Committed
Undecided
Pradeep Kumar Singh

Bug Description

stack@vagrant:~$ zun create --name "Pradeep Singh" --image busybox
+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Property | Value |
+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| status | Creating |
| workdir | None |
| name | Pradeep Singh |
| links | ["{u'href': u'http://10.0.2.15:9517/v1/containers/f3bfaf5a-a3e7-48c8-9aa1-d9aa35ca753e', u'rel': u'self'}", "{u'href': u'http://10.0.2.15:9517/containers/f3bfaf5a-a3e7-48c8-9aa1-d9aa35ca753e', u'rel': u'bookmark'}"] |
| image | busybox |
| labels | {} |
| cpu | None |
| environment | {} |
| command | None |
| hostname | None |
| memory | None |
| task_state | None |
| status_reason | None |
| ports | [] |
| uuid | f3bfaf5a-a3e7-48c8-9aa1-d9aa35ca753e |
+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
stack@vagrant:~$ docker run --name "Pradeep Singh" busybox
Unable to find image 'busybox:latest' locally
latest: Pulling from library/busybox
56bec22e3559: Pull complete
Digest: sha256:29f5d56d12684887bdfa50dcd29fc31eea4aaf4ad3bec43daf19026a7ce69912
Status: Downloaded newer image for busybox:latest
docker: Error response from daemon: Invalid container name (Pradeep Singh), only [a-zA-Z0-9][a-zA-Z0-9_.-] are allowed.
See 'docker run --help'.
stack@vagrant:~$ zun show "Pradeep Singh"
+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Property | Value |
+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| status | Error |
| workdir | None |
| name | Pradeep Singh |
| links | ["{u'href': u'http://10.0.2.15:9517/v1/containers/f3bfaf5a-a3e7-48c8-9aa1-d9aa35ca753e', u'rel': u'self'}", "{u'href': u'http://10.0.2.15:9517/containers/f3bfaf5a-a3e7-48c8-9aa1-d9aa35ca753e', u'rel': u'bookmark'}"] |
| image | busybox |
| labels | {} |
| cpu | None |
| environment | {} |
| command | None |
| hostname | None |
| memory | None |
| task_state | None |
| status_reason | Image busybox not found |
| ports | [] |
| uuid | f3bfaf5a-a3e7-48c8-9aa1-d9aa35ca753e |
+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
stack@vagrant:~$

Changed in zun:
assignee: nobody → Pradeep Kumar Singh (pradeep-singh-u)
status: New → Confirmed
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/396028

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

Reviewed: https://review.openstack.org/396028
Committed: https://git.openstack.org/cgit/openstack/zun/commit/?id=5d78766b954f62bb9e177a6f12eec84a20d21071
Submitter: Jenkins
Branch: master

commit 5d78766b954f62bb9e177a6f12eec84a20d21071
Author: Pradeep Kumar Singh <email address hidden>
Date: Thu Nov 10 08:55:06 2016 +0000

    Fix Container name match regular expression

    Currently container name may contain spaces, the
    regular expression is not valid. This patch fixes that
    regular expression and adds unit tests.

    NOTE: This patch doesn't fix the regular expression for
    image name, because that is more complicated to be handled
    now, i will propose another patch with that fix.

    Close-bug: #1640680

    Change-Id: Id99afda8dab5ee2f86d6f50e1988e9eba8542270

Changed in zun:
status: Confirmed → Fix Committed
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.