docs: image schema customization restrictions

Bug #1856578 reported by Brian Rosmaita
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Undecided
Khuong Luu

Bug Description

An operator can modify /etc/schema-image.json to include arbitrary properties (which was that file's original purpose) and assign them JSON types other than 'string'.

The type is enforced by image create/update but an end-user making a call that sets a value on one of these gets a 500. This is because everything in the image_properties table must be a string in the database. The API, however, won't accept a string value when the schema says it's boolean or some other non-string JSON data type). We should document:

(1) these things *must* be strings

(2) recommend that operators not delete items from the default schema-image.json file, because this will affect interoperability

(3) maybe recommend using metadefs instead of modifying the image schema?

Changed in glance:
assignee: nobody → Khuong Luu (organic-doge)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

Fix proposed to branch: master
Review: https://review.opendev.org/717889

Changed in glance:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.opendev.org/717889
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=bd16ab256e6bf6b423f3bdbd366ba0b56d5bc619
Submitter: Zuul
Branch: master

commit bd16ab256e6bf6b423f3bdbd366ba0b56d5bc619
Author: khashf <email address hidden>
Date: Mon Apr 6 17:59:13 2020 -0700

    Add warning and note on image schema customization docs

    An operator can modify /etc/schema-image.json to include arbitrary
    properties (which was that file's original purpose) and assign them JSON
    types other than 'string'. The type is enforced by image create/update
    but an end-user making a call that sets a value on one of these gets a
    500.

    This patch add the following recommendations to the documentation:
    - Value of `type` of each property in the JSON scheme must be `string`
    - Do not delete items from the default schema-image.json file
    - If operator's need is more complicated, suggest them using metadefs

    Co-authored-by: Brian Rosmaita <email address hidden>

    Change-Id: I879f4440a14b1e8420e230de84bfba5e0419a4d4
    Closes-bug: #1856578

Changed in glance:
status: In Progress → Fix Released
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.