v2 API allows you to tag image with same value multiple times

Bug #1035961 reported by Brian Waldon on 2012-08-12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Brian Waldon

Bug Description

If I make the following request thrice:

curl -X PUT -i -H 'x-auth-token: ff7c20e1cf7b4495a61044c0daa6be0f' http://localhost:9292/v2/images/2ae976a0-e2fd-4bde-a05b-df3e8f92fc26/tags/pants

It results in an image with a 'tags' list containing three 'pants' tags:

{"status": "queued", "name": "asdf", "tags": ["pants", "pants", "pants"], "container_format": "ari", "created_at": "2012-08-12T20:29:49Z", "disk_format": "ari", "updated_at": "2012-08-12T20:29:49Z", "visibility": "private", "id": "2ae976a0-e2fd-4bde-a05b-df3e8f92fc26", "protected": false, "min_ram": 0, "file": "/v2/images/2ae976a0-e2fd-4bde-a05b-df3e8f92fc26/file", "min_disk": 0, "size": 0, "self": "/v2/images/2ae976a0-e2fd-4bde-a05b-df3e8f92fc26", "schema": "/v2/schemas/image"}

The API should not allow an image to be tagged with the same string multiple times.

Related branches

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

Changed in glance:
status: Triaged → In Progress

Reviewed: https://review.openstack.org/11252
Committed: http://github.com/openstack/glance/commit/2bed42cd3c42cc19e3d5c6d16fe69fa94f627447
Submitter: Jenkins
Branch: master

commit 2bed42cd3c42cc19e3d5c6d16fe69fa94f627447
Author: Brian Waldon <email address hidden>
Date: Sun Aug 12 14:30:20 2012 -0700

    Ignore duplicate tags in v2 API

    * Creating/updating an image with duplicate tags should result in
      only a single instance of that tag being added
    * Attempting to explicitly tag an image with a duplicate tag
      should result in no tags being added
    * Fixes bug 1035961

    Change-Id: Ie16091f046de98914aea1a1a6777773ddc95c615

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2012-08-15
Changed in glance:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2012-09-27
Changed in glance:
milestone: folsom-3 → 2012.2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers