)]}'
{"specs/stein/approved/glance/spec-lite-locations-with-validation-data.rst":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"344648a28dc50b0092349319607a9659a2df8116","unresolved":false,"context_lines":[{"line_number":16,"context_line":"          accompanying checksum or/and multihash attributes."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":":solution: Allow embedding of values for ``checksum``, ``os_hash_algo``"},{"line_number":19,"context_line":"\t   and ``os_hash_value`` in a new object named ``validation_data`` when"},{"line_number":20,"context_line":"           updating ``locations`` for an image. New values will be accepted"},{"line_number":21,"context_line":"\t   only if the image status is ``queued``. The object may be included"},{"line_number":22,"context_line":"\t   in one or more of the items in the ``locations`` list, but values"}],"source_content_type":"text/x-rst","patch_set":5,"id":"3f79a3b5_8214a942","line":19,"updated":"2018-09-18 05:15:07.000000000","message":"\u003e\u003e these occurrences were added by mistake, need to remove this.","commit_id":"61627eef0d709e3a3ca9e0c36e26ea08760543f8"},{"author":{"_account_id":23561,"name":"iain MacDonnell","email":"iain.macdonnell@oracle.com","username":"imacdonn"},"change_message_id":"87c4c9aafd4f95f8ef8c660da5b007d661f92ed8","unresolved":false,"context_lines":[{"line_number":16,"context_line":"          accompanying checksum or/and multihash attributes."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":":solution: Allow embedding of values for ``checksum``, ``os_hash_algo``"},{"line_number":19,"context_line":"\t   and ``os_hash_value`` in a new object named ``validation_data`` when"},{"line_number":20,"context_line":"           updating ``locations`` for an image. New values will be accepted"},{"line_number":21,"context_line":"\t   only if the image status is ``queued``. The object may be included"},{"line_number":22,"context_line":"\t   in one or more of the items in the ``locations`` list, but values"}],"source_content_type":"text/x-rst","patch_set":5,"id":"3f79a3b5_62a62d57","line":19,"in_reply_to":"3f79a3b5_8214a942","updated":"2018-09-18 06:26:58.000000000","message":"\u003e \u003e\u003e these occurrences were added by mistake, need to remove this.\n\nI don\u0027t see the mistake. Are you reading it wrong, perhaps? The three items are included in the JSON object named \"validation_data\" as discussed. Example is below.... ?","commit_id":"61627eef0d709e3a3ca9e0c36e26ea08760543f8"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"7a3995de83c8835bdc688586575bf9995846d021","unresolved":false,"context_lines":[{"line_number":25,"context_line":"           The object may be included in one or more of the items in a"},{"line_number":26,"context_line":"           ``locations`` list, but values must be consistent across all"},{"line_number":27,"context_line":"           instances. Although the ``validation_data`` object will be optional,"},{"line_number":28,"context_line":"           if it is present, all three fields must be populated, to force"},{"line_number":29,"context_line":"           adoption of multihash. ``os_hash_algo`` must be one of the"},{"line_number":30,"context_line":"           algorthirms supported by hashlib. Any violations of these rules will"},{"line_number":31,"context_line":"           result in a ``HTTPConflict`` exception (HTTP status 409)."},{"line_number":32,"context_line":""}],"source_content_type":"text/x-rst","patch_set":8,"id":"3f79a3b5_d6d5921b","line":29,"range":{"start_line":28,"start_character":11,"end_line":29,"end_character":32},"updated":"2018-10-11 13:23:40.000000000","message":"Just want to emphasize this for other reviewers.  I think it\u0027s a good idea.  (There\u0027s a workaround for people who only have the md5sum for the data, namely, to use \u0027md5\u0027 as the os_hash_algo and the md5sum as the os_hash_value.  So this shouldn\u0027t pose an undue burden on image creators.)","commit_id":"4b21db3277db9389acd4208805c1af9fee32e10d"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"f860d59c249939ec55388ddbc27e930290ed835c","unresolved":false,"context_lines":[{"line_number":27,"context_line":"           instances. Although the ``validation_data`` object will be optional,"},{"line_number":28,"context_line":"           if it is present, all three fields must be populated, to force"},{"line_number":29,"context_line":"           adoption of multihash. ``os_hash_algo`` must be one of the"},{"line_number":30,"context_line":"           algorthirms supported by hashlib. Any violations of these rules will"},{"line_number":31,"context_line":"           result in a ``HTTPConflict`` exception (HTTP status 409)."},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"           The following will be added to the properties for ``locations``"}],"source_content_type":"text/x-rst","patch_set":8,"id":"3f79a3b5_f61f6e57","line":30,"range":{"start_line":30,"start_character":11,"end_line":30,"end_character":22},"updated":"2018-10-11 13:17:09.000000000","message":"algorithms","commit_id":"4b21db3277db9389acd4208805c1af9fee32e10d"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"f860d59c249939ec55388ddbc27e930290ed835c","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"             \u0027validation_data\u0027: {"},{"line_number":37,"context_line":"                 \u0027description\u0027: _(\u0027Values to be used to populate the \u0027"},{"line_number":38,"context_line":"                                  \u0027corresponding image propertries. \u0027"},{"line_number":39,"context_line":"                                  \u0027New values may only be provided \u0027"},{"line_number":40,"context_line":"                                  \u0027when the image status is \"queued\"\u0027),"},{"line_number":41,"context_line":"                 \u0027type\u0027: \u0027object\u0027,"}],"source_content_type":"text/x-rst","patch_set":8,"id":"3f79a3b5_b63576dd","line":38,"range":{"start_line":38,"start_character":55,"end_line":38,"end_character":66},"updated":"2018-10-11 13:17:09.000000000","message":"properties","commit_id":"4b21db3277db9389acd4208805c1af9fee32e10d"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"f860d59c249939ec55388ddbc27e930290ed835c","unresolved":false,"context_lines":[{"line_number":36,"context_line":"             \u0027validation_data\u0027: {"},{"line_number":37,"context_line":"                 \u0027description\u0027: _(\u0027Values to be used to populate the \u0027"},{"line_number":38,"context_line":"                                  \u0027corresponding image propertries. \u0027"},{"line_number":39,"context_line":"                                  \u0027New values may only be provided \u0027"},{"line_number":40,"context_line":"                                  \u0027when the image status is \"queued\"\u0027),"},{"line_number":41,"context_line":"                 \u0027type\u0027: \u0027object\u0027,"},{"line_number":42,"context_line":"                 \u0027writeOnly\u0027: True,"}],"source_content_type":"text/x-rst","patch_set":8,"id":"3f79a3b5_f66d2ecb","line":39,"range":{"start_line":39,"start_character":35,"end_line":39,"end_character":45},"updated":"2018-10-11 13:17:09.000000000","message":"suggestion: change this simply to \u0027Values\u0027","commit_id":"4b21db3277db9389acd4208805c1af9fee32e10d"},{"author":{"_account_id":23561,"name":"iain MacDonnell","email":"iain.macdonnell@oracle.com","username":"imacdonn"},"change_message_id":"8b1907864cceb985389c52d6d2be16f57e2aea8e","unresolved":false,"context_lines":[{"line_number":36,"context_line":"             \u0027validation_data\u0027: {"},{"line_number":37,"context_line":"                 \u0027description\u0027: _(\u0027Values to be used to populate the \u0027"},{"line_number":38,"context_line":"                                  \u0027corresponding image propertries. \u0027"},{"line_number":39,"context_line":"                                  \u0027New values may only be provided \u0027"},{"line_number":40,"context_line":"                                  \u0027when the image status is \"queued\"\u0027),"},{"line_number":41,"context_line":"                 \u0027type\u0027: \u0027object\u0027,"},{"line_number":42,"context_line":"                 \u0027writeOnly\u0027: True,"}],"source_content_type":"text/x-rst","patch_set":8,"id":"3f79a3b5_b4b4711e","line":39,"range":{"start_line":39,"start_character":35,"end_line":39,"end_character":45},"in_reply_to":"3f79a3b5_28a24cfc","updated":"2018-10-12 15:06:03.000000000","message":"It\u0027s more pertinent to the \"replace\" case. Replacing the entire \"/locations\" list with the exact same data a second (or subsequent) time should not produce a different result. For the \"add\" case, I think the validation_data should still be accepted, so long as it\u0027s identical to what\u0027s already there, so that the consumer doesn\u0027t have to make a decision about whether or not to include it. I can remove this if it\u0027s contentious, but it seems like the right thing to do...","commit_id":"4b21db3277db9389acd4208805c1af9fee32e10d"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"c7e8163aaec76cd6d95f3dec27ecbd14fa898dc5","unresolved":false,"context_lines":[{"line_number":36,"context_line":"             \u0027validation_data\u0027: {"},{"line_number":37,"context_line":"                 \u0027description\u0027: _(\u0027Values to be used to populate the \u0027"},{"line_number":38,"context_line":"                                  \u0027corresponding image propertries. \u0027"},{"line_number":39,"context_line":"                                  \u0027New values may only be provided \u0027"},{"line_number":40,"context_line":"                                  \u0027when the image status is \"queued\"\u0027),"},{"line_number":41,"context_line":"                 \u0027type\u0027: \u0027object\u0027,"},{"line_number":42,"context_line":"                 \u0027writeOnly\u0027: True,"}],"source_content_type":"text/x-rst","patch_set":8,"id":"3f79a3b5_28a24cfc","line":39,"range":{"start_line":39,"start_character":35,"end_line":39,"end_character":45},"in_reply_to":"3f79a3b5_f0544eff","updated":"2018-10-12 12:21:21.000000000","message":"Can you explain this a bit more? In general, PATCH isn\u0027t considered idempotent.  I take it you mean that if image 123 is active with checksum/multihash set and len(locations) \u003d\u003d 1, and I do an op:add of a new location with validation_data containing the same checksum/multihash values as on image 123, you want the op:add to succeed?","commit_id":"4b21db3277db9389acd4208805c1af9fee32e10d"},{"author":{"_account_id":23561,"name":"iain MacDonnell","email":"iain.macdonnell@oracle.com","username":"imacdonn"},"change_message_id":"1b61601ab54b1ffab194077b3be7854e37d2d791","unresolved":false,"context_lines":[{"line_number":36,"context_line":"             \u0027validation_data\u0027: {"},{"line_number":37,"context_line":"                 \u0027description\u0027: _(\u0027Values to be used to populate the \u0027"},{"line_number":38,"context_line":"                                  \u0027corresponding image propertries. \u0027"},{"line_number":39,"context_line":"                                  \u0027New values may only be provided \u0027"},{"line_number":40,"context_line":"                                  \u0027when the image status is \"queued\"\u0027),"},{"line_number":41,"context_line":"                 \u0027type\u0027: \u0027object\u0027,"},{"line_number":42,"context_line":"                 \u0027writeOnly\u0027: True,"}],"source_content_type":"text/x-rst","patch_set":8,"id":"3f79a3b5_f0544eff","line":39,"range":{"start_line":39,"start_character":35,"end_line":39,"end_character":45},"in_reply_to":"3f79a3b5_f66d2ecb","updated":"2018-10-11 16:25:42.000000000","message":"Inclusion of the word \"New\" was deliberate. I think it\u0027s important to allow these values to be included when adding or replacing locations to an \"active\" image *so long as they don\u0027t have different values*, so that idempotence of these operations can be maintained.","commit_id":"4b21db3277db9389acd4208805c1af9fee32e10d"},{"author":{"_account_id":23561,"name":"iain MacDonnell","email":"iain.macdonnell@oracle.com","username":"imacdonn"},"change_message_id":"8c553d8d14fb2e0a2adfcdade4463fc0188fd88d","unresolved":false,"context_lines":[{"line_number":10,"context_line":""},{"line_number":11,"context_line":":project: glance"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":":problem: A new image using the HTTP store may have its ``locations``"},{"line_number":14,"context_line":"          initialised using the ``add`` or ``replace`` operation in an HTTP"},{"line_number":15,"context_line":"          PATCH request, but there is currently no way to provide values for"},{"line_number":16,"context_line":"          accompanying checksum and multihash values."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":":solution: Allow embedding of values for ``checksum``, ``os_hash_algo``"},{"line_number":19,"context_line":"           and ``os_hash_value`` in a new write-only JSON object named"},{"line_number":20,"context_line":"           ``validation_data``, along with the ``url`` and ``metadata`` for an"},{"line_number":21,"context_line":"           image location. These values will be used to populate the"},{"line_number":22,"context_line":"           corresponding image properties."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"           Whilst this new object may be included when updating an existing"},{"line_number":25,"context_line":"           image (idempotency should be maintained), if the image status is not"}],"source_content_type":"text/x-rst","patch_set":9,"id":"3f79a3b5_33a6bbae","line":22,"range":{"start_line":13,"start_character":0,"end_line":22,"end_character":42},"updated":"2018-10-18 17:13:37.000000000","message":"To me, this clearly states the ability to embed the new JSON object when using the existing PATCH mechanism, yet there was some question about this. I think this wording is sufficient....?","commit_id":"6d6e036876850664098008768e53099ed375b034"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"c66b6cf0666270aa839e0d027e9229ce6d1359e3","unresolved":false,"context_lines":[{"line_number":10,"context_line":""},{"line_number":11,"context_line":":project: glance"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":":problem: A new image using the HTTP store may have its ``locations``"},{"line_number":14,"context_line":"          initialised using the ``add`` or ``replace`` operation in an HTTP"},{"line_number":15,"context_line":"          PATCH request, but there is currently no way to provide values for"},{"line_number":16,"context_line":"          accompanying checksum and multihash values."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":":solution: Allow embedding of values for ``checksum``, ``os_hash_algo``"},{"line_number":19,"context_line":"           and ``os_hash_value`` in a new write-only JSON object named"},{"line_number":20,"context_line":"           ``validation_data``, along with the ``url`` and ``metadata`` for an"},{"line_number":21,"context_line":"           image location. These values will be used to populate the"},{"line_number":22,"context_line":"           corresponding image properties."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"           Whilst this new object may be included when updating an existing"},{"line_number":25,"context_line":"           image (idempotency should be maintained), if the image status is not"}],"source_content_type":"text/x-rst","patch_set":9,"id":"3f79a3b5_fb556afa","line":22,"range":{"start_line":13,"start_character":0,"end_line":22,"end_character":42},"in_reply_to":"3f79a3b5_33a6bbae","updated":"2018-10-19 11:59:49.000000000","message":"Yes, indeed.","commit_id":"6d6e036876850664098008768e53099ed375b034"},{"author":{"_account_id":23561,"name":"iain MacDonnell","email":"iain.macdonnell@oracle.com","username":"imacdonn"},"change_message_id":"8c553d8d14fb2e0a2adfcdade4463fc0188fd88d","unresolved":false,"context_lines":[{"line_number":28,"context_line":"           the items in a ``locations`` list, but values must be consistent"},{"line_number":29,"context_line":"           across all instances. Although the ``validation_data`` object will"},{"line_number":30,"context_line":"           be optional, if it is present, all three fields must be populated,"},{"line_number":31,"context_line":"           to force adoption of multihash. ``os_hash_algo`` must be one of the"},{"line_number":32,"context_line":"           algorithms supported by hashlib. Any violations of these rules will"},{"line_number":33,"context_line":"           result in a ``HTTPConflict`` exception (HTTP status 409)."},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"           The following will be added to the properties for ``locations``"}],"source_content_type":"text/x-rst","patch_set":9,"id":"3f79a3b5_3371db46","line":32,"range":{"start_line":31,"start_character":43,"end_line":32,"end_character":43},"updated":"2018-10-18 17:13:37.000000000","message":"There was some concern about the hash algo having to match the one that glance is configured with (and what would happen if glance is not configured with any). IMO, there should not be a requirement for either of those in this case, since glance is neither computing nor validating the hash, so there\u0027s no need for it to use any particular algo - only that it must be one of those supported by hashlib. Any client consuming the image is expected to use hashlib, or something functionally equivalent, to be able to validate the hash.","commit_id":"6d6e036876850664098008768e53099ed375b034"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"c66b6cf0666270aa839e0d027e9229ce6d1359e3","unresolved":false,"context_lines":[{"line_number":28,"context_line":"           the items in a ``locations`` list, but values must be consistent"},{"line_number":29,"context_line":"           across all instances. Although the ``validation_data`` object will"},{"line_number":30,"context_line":"           be optional, if it is present, all three fields must be populated,"},{"line_number":31,"context_line":"           to force adoption of multihash. ``os_hash_algo`` must be one of the"},{"line_number":32,"context_line":"           algorithms supported by hashlib. Any violations of these rules will"},{"line_number":33,"context_line":"           result in a ``HTTPConflict`` exception (HTTP status 409)."},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"           The following will be added to the properties for ``locations``"}],"source_content_type":"text/x-rst","patch_set":9,"id":"3f79a3b5_fb580afa","line":32,"range":{"start_line":31,"start_character":43,"end_line":32,"end_character":43},"in_reply_to":"3f79a3b5_3371db46","updated":"2018-10-19 11:59:49.000000000","message":"I think we should stick with the algorithm that has been picked by the operator instead of allowing the user to use what ever. One of my concerns is the performance numbers we saw https://specs.openstack.org/openstack/glance-specs/specs/rocky/implemented/glance/multihash.html#performance-impact and there is quite a significant differences say between sha256 and sha512 from the most popular ones. This would also limit the algorithms to the one possibly certified by the security team for the cloud\u0027s usage. Just allowing md5 twice is not going to be productive here. If we allow that, it\u0027d be better to not just require all three fields.\n\nI\u0027d rather keep the options very clear and predictable what will be found within the deployment and relax the requirements based of the feedback if needed.","commit_id":"6d6e036876850664098008768e53099ed375b034"},{"author":{"_account_id":23561,"name":"iain MacDonnell","email":"iain.macdonnell@oracle.com","username":"imacdonn"},"change_message_id":"f47201e905e6cea60e15ceb8fce16c0822971ce3","unresolved":false,"context_lines":[{"line_number":28,"context_line":"           the items in a ``locations`` list, but values must be consistent"},{"line_number":29,"context_line":"           across all instances. Although the ``validation_data`` object will"},{"line_number":30,"context_line":"           be optional, if it is present, all three fields must be populated,"},{"line_number":31,"context_line":"           to force adoption of multihash. ``os_hash_algo`` must be one of the"},{"line_number":32,"context_line":"           algorithms supported by hashlib. Any violations of these rules will"},{"line_number":33,"context_line":"           result in a ``HTTPConflict`` exception (HTTP status 409)."},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"           The following will be added to the properties for ``locations``"}],"source_content_type":"text/x-rst","patch_set":9,"id":"3f79a3b5_d8b94d7c","line":32,"range":{"start_line":31,"start_character":43,"end_line":32,"end_character":43},"in_reply_to":"3f79a3b5_89ebaddb","updated":"2018-10-23 18:19:28.000000000","message":"\u003e Also having hard requirement for all the 3 values will cause the\n \u003e same situation. By quick research Ubuntu and Debian seemed to be\n \u003e the only ones delivering public images with MD5 and and variants of\n \u003e SHA hashes, the rest does not seem to provide MD5s anymore which\n \u003e will cause the same scenario where you need to download the image\n \u003e to calculate the md5 hash to be able to set any other hash (cirros\n \u003e provides just MD5s).\n \nThat\u0027s true. I could make checksum optional (since, I suppose, it\u0027s\nconsidered the \"legacy\" mechanism. The tactical problem right now is\nthat, AFAIK, nothing (cinder, nova?) has actually implemented\nmultihash yet, so a checksum is required to get any sort of integrity\ncheck on the image contents. Presumably that is a (somewhat) short-term\nproblem, though...","commit_id":"6d6e036876850664098008768e53099ed375b034"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"4921b848a8c352335d7b057665239948b305b3fc","unresolved":false,"context_lines":[{"line_number":28,"context_line":"           the items in a ``locations`` list, but values must be consistent"},{"line_number":29,"context_line":"           across all instances. Although the ``validation_data`` object will"},{"line_number":30,"context_line":"           be optional, if it is present, all three fields must be populated,"},{"line_number":31,"context_line":"           to force adoption of multihash. ``os_hash_algo`` must be one of the"},{"line_number":32,"context_line":"           algorithms supported by hashlib. Any violations of these rules will"},{"line_number":33,"context_line":"           result in a ``HTTPConflict`` exception (HTTP status 409)."},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"           The following will be added to the properties for ``locations``"}],"source_content_type":"text/x-rst","patch_set":9,"id":"3f79a3b5_89ebaddb","line":32,"range":{"start_line":31,"start_character":43,"end_line":32,"end_character":43},"in_reply_to":"3f79a3b5_a5b82c78","updated":"2018-10-22 14:48:22.000000000","message":"So we have the discovery api in glance for delivering this kind of information. How were you planning to communicate the supported algortihms in the deployment to the user? (Hashlib quarantees few and after that accept what ever the OpenSSL lib in the system happens to have enabled.)\n\nHaving the algo in the request is a good idea to enforce that the user acknowledges what hash they are providing.\n\nAlso having hard requirement for all the 3 values will cause the same situation. By quick research Ubuntu and Debian seemed to be the only ones delivering public images with MD5 and and variants of SHA hashes, the rest does not seem to provide MD5s anymore which will cause the same scenario where you need to download the image to calculate the md5 hash to be able to set any other hash (cirros provides just MD5s).\n\nI guess we can open the type for what ever algorithm after all being able to use this feature is very heavily controlled due it being exposed only via the locations api.","commit_id":"6d6e036876850664098008768e53099ed375b034"},{"author":{"_account_id":23561,"name":"iain MacDonnell","email":"iain.macdonnell@oracle.com","username":"imacdonn"},"change_message_id":"2ef6af1c5e68def995a1f7fb2628221002b099f0","unresolved":false,"context_lines":[{"line_number":28,"context_line":"           the items in a ``locations`` list, but values must be consistent"},{"line_number":29,"context_line":"           across all instances. Although the ``validation_data`` object will"},{"line_number":30,"context_line":"           be optional, if it is present, all three fields must be populated,"},{"line_number":31,"context_line":"           to force adoption of multihash. ``os_hash_algo`` must be one of the"},{"line_number":32,"context_line":"           algorithms supported by hashlib. Any violations of these rules will"},{"line_number":33,"context_line":"           result in a ``HTTPConflict`` exception (HTTP status 409)."},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"           The following will be added to the properties for ``locations``"}],"source_content_type":"text/x-rst","patch_set":9,"id":"3f79a3b5_a5b82c78","line":32,"range":{"start_line":31,"start_character":43,"end_line":32,"end_character":43},"in_reply_to":"3f79a3b5_fb580afa","updated":"2018-10-19 16:03:37.000000000","message":"It seems stupid to have an option for which there is only one acceptable value. \"What algoithm would you like to use?\" \"sha512\" \"Sorry, that is the wrong answer. What algorithm would you like to use?\" If we\u0027re going to be dictatorial about this, we might as well remove os_hash_algo from the validation_data object.\n\nA problem, as Brian pointed out, is that there\u0027s no way for a consumer to know what algorithm they\u0027re going to be forced to use (other than asking an admin... or trial\u0027n\u0027error, I suppose).\n\nI\u0027m looking at this from the perspective of being able to consume images that were published by some other entity (not the cloud operator, and not even the cloud consumer). The publishing entity should be able to make available an acceptable hash along with their images (in my case, they already publish md5sum checksums). The OpenStack implementation should be able to accept any hashlib-compatible algorithm. Otherwise, if the cloud consumer wants to use an image from a publisher that didn\u0027t happen to choose the same algorithm as the cloud operator, the consumer must download the image, verify one form of hash, calculate a new hash, then register the image with glance.","commit_id":"6d6e036876850664098008768e53099ed375b034"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"0dfc9243e17132dd450b008bfe1ff7aad3d3a566","unresolved":false,"context_lines":[{"line_number":38,"context_line":"             \u0027validation_data\u0027: {"},{"line_number":39,"context_line":"                 \u0027description\u0027: _("},{"line_number":40,"context_line":"                     \u0027Values to be used to populate the corresponding \u0027"},{"line_number":41,"context_line":"                     \u0027image properties. If the image status is not \u0027"},{"line_number":42,"context_line":"                     \u0027\"queued\", values must exactly match those \u0027"},{"line_number":43,"context_line":"                     \u0027already contained in the image properties.\u0027"},{"line_number":44,"context_line":"                 ),"},{"line_number":45,"context_line":"                 \u0027type\u0027: \u0027object\u0027,"},{"line_number":46,"context_line":"                 \u0027writeOnly\u0027: True,"}],"source_content_type":"text/x-rst","patch_set":9,"id":"3f79a3b5_87fd143e","line":43,"range":{"start_line":41,"start_character":40,"end_line":43,"end_character":64},"updated":"2018-10-18 13:09:46.000000000","message":"This sets clear expectations for how the validation_data will be used.  I agree that it\u0027s less confusing to the user to allow it on subsequent calls.","commit_id":"6d6e036876850664098008768e53099ed375b034"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"11057d896795a7e9f9116a394abdf926676c524c","unresolved":false,"context_lines":[{"line_number":38,"context_line":"             \u0027validation_data\u0027: {"},{"line_number":39,"context_line":"                 \u0027description\u0027: _("},{"line_number":40,"context_line":"                     \u0027Values to be used to populate the corresponding \u0027"},{"line_number":41,"context_line":"                     \u0027image properties. If the image status is not \u0027"},{"line_number":42,"context_line":"                     \u0027\"queued\", values must exactly match those \u0027"},{"line_number":43,"context_line":"                     \u0027already contained in the image properties.\u0027"},{"line_number":44,"context_line":"                 ),"},{"line_number":45,"context_line":"                 \u0027type\u0027: \u0027object\u0027,"},{"line_number":46,"context_line":"                 \u0027writeOnly\u0027: True,"}],"source_content_type":"text/x-rst","patch_set":9,"id":"3f79a3b5_d41cd815","line":43,"range":{"start_line":41,"start_character":40,"end_line":43,"end_character":64},"in_reply_to":"3f79a3b5_49c27504","updated":"2018-10-22 15:11:30.000000000","message":"I\u0027m pretty sure checksums were one of those image properties that are settable once regardless of the image status. Say: 1) create image record 2) use the replace call to add 2 of your 3 backends and checksums (image stays queued) 3) realize you had typo on the checksum and when doing add your last location (which will activate the image) you include the correct checksum data to the call. I\u0027m quite certain glance-api will barf you trying to reset the checksum way down on the layers and fail the request. I wasn\u0027t suggesting us to write code to enforce this, merely just change the wording to reflect what I assume is the reality.","commit_id":"6d6e036876850664098008768e53099ed375b034"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"cb61fcf1a15bd1fcf1535bf9d8809a31c730386b","unresolved":false,"context_lines":[{"line_number":38,"context_line":"             \u0027validation_data\u0027: {"},{"line_number":39,"context_line":"                 \u0027description\u0027: _("},{"line_number":40,"context_line":"                     \u0027Values to be used to populate the corresponding \u0027"},{"line_number":41,"context_line":"                     \u0027image properties. If the image status is not \u0027"},{"line_number":42,"context_line":"                     \u0027\"queued\", values must exactly match those \u0027"},{"line_number":43,"context_line":"                     \u0027already contained in the image properties.\u0027"},{"line_number":44,"context_line":"                 ),"},{"line_number":45,"context_line":"                 \u0027type\u0027: \u0027object\u0027,"},{"line_number":46,"context_line":"                 \u0027writeOnly\u0027: True,"}],"source_content_type":"text/x-rst","patch_set":9,"id":"3f79a3b5_49c27504","line":43,"range":{"start_line":41,"start_character":40,"end_line":43,"end_character":64},"in_reply_to":"3f79a3b5_566c6c04","updated":"2018-10-22 14:58:20.000000000","message":"I\u0027m becoming confused about this, too.  I was understanding \"values must exactly match those already contained in the image properties\" to include None (null in JSON) if the image has gone active with no checksum/os_hash_* values set.  My understanding of Iain\u0027s idempotency concern is that if an image is queued, and someone adds location\n\n    { \"url\": \"http://first.url\",\n      \"validation_data\": {\"checksum\": 12345, ... },\n      \"metadata\": { \"key1\": \"value1\" }\n    }\n\nthe image will go active with checksum and os_hash_* set to the specified values.  If someone then adds another location to the image, we\u0027ll allow this JSON to be used\n\n    { \"url\": \"http://second.url\",\n      \"validation_data\": {\"checksum\": 12345, ... },\n      \"metadata\": { \"key1\": \"value2\" }\n    }\n\nas long as the values for the validation_data match what\u0027s currently set on the image.  In other words, the validation_data on this second call won\u0027t actually do anything, but it will allow the user to use the same location object format for each call.  But I think that we still want the validation_data to be functional only for queued images?","commit_id":"6d6e036876850664098008768e53099ed375b034"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"4921b848a8c352335d7b057665239948b305b3fc","unresolved":false,"context_lines":[{"line_number":38,"context_line":"             \u0027validation_data\u0027: {"},{"line_number":39,"context_line":"                 \u0027description\u0027: _("},{"line_number":40,"context_line":"                     \u0027Values to be used to populate the corresponding \u0027"},{"line_number":41,"context_line":"                     \u0027image properties. If the image status is not \u0027"},{"line_number":42,"context_line":"                     \u0027\"queued\", values must exactly match those \u0027"},{"line_number":43,"context_line":"                     \u0027already contained in the image properties.\u0027"},{"line_number":44,"context_line":"                 ),"},{"line_number":45,"context_line":"                 \u0027type\u0027: \u0027object\u0027,"},{"line_number":46,"context_line":"                 \u0027writeOnly\u0027: True,"}],"source_content_type":"text/x-rst","patch_set":9,"id":"3f79a3b5_26440673","line":43,"range":{"start_line":41,"start_character":40,"end_line":43,"end_character":64},"in_reply_to":"3f79a3b5_566c6c04","updated":"2018-10-22 14:48:22.000000000","message":"No, it might be that these were not one of these only once writable image attributes like I thought. I did not try to change it once it\u0027s set, just assumed Glance would fail it.","commit_id":"6d6e036876850664098008768e53099ed375b034"},{"author":{"_account_id":23561,"name":"iain MacDonnell","email":"iain.macdonnell@oracle.com","username":"imacdonn"},"change_message_id":"f99d01d2af3d81001a3eaf7aa83606e81783acff","unresolved":false,"context_lines":[{"line_number":38,"context_line":"             \u0027validation_data\u0027: {"},{"line_number":39,"context_line":"                 \u0027description\u0027: _("},{"line_number":40,"context_line":"                     \u0027Values to be used to populate the corresponding \u0027"},{"line_number":41,"context_line":"                     \u0027image properties. If the image status is not \u0027"},{"line_number":42,"context_line":"                     \u0027\"queued\", values must exactly match those \u0027"},{"line_number":43,"context_line":"                     \u0027already contained in the image properties.\u0027"},{"line_number":44,"context_line":"                 ),"},{"line_number":45,"context_line":"                 \u0027type\u0027: \u0027object\u0027,"},{"line_number":46,"context_line":"                 \u0027writeOnly\u0027: True,"}],"source_content_type":"text/x-rst","patch_set":9,"id":"3f79a3b5_566c6c04","line":43,"range":{"start_line":41,"start_character":40,"end_line":43,"end_character":64},"in_reply_to":"3f79a3b5_65b21499","updated":"2018-10-19 18:23:35.000000000","message":"I just re-read this. Are you saying that it should be permitted to provide values if there are currently none, even if the image is already \"active\"? I thought that the requirement that this only for work \"queued\" images was absolute....","commit_id":"6d6e036876850664098008768e53099ed375b034"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"c66b6cf0666270aa839e0d027e9229ce6d1359e3","unresolved":false,"context_lines":[{"line_number":38,"context_line":"             \u0027validation_data\u0027: {"},{"line_number":39,"context_line":"                 \u0027description\u0027: _("},{"line_number":40,"context_line":"                     \u0027Values to be used to populate the corresponding \u0027"},{"line_number":41,"context_line":"                     \u0027image properties. If the image status is not \u0027"},{"line_number":42,"context_line":"                     \u0027\"queued\", values must exactly match those \u0027"},{"line_number":43,"context_line":"                     \u0027already contained in the image properties.\u0027"},{"line_number":44,"context_line":"                 ),"},{"line_number":45,"context_line":"                 \u0027type\u0027: \u0027object\u0027,"},{"line_number":46,"context_line":"                 \u0027writeOnly\u0027: True,"}],"source_content_type":"text/x-rst","patch_set":9,"id":"3f79a3b5_9bf236e4","line":43,"range":{"start_line":41,"start_character":40,"end_line":43,"end_character":64},"in_reply_to":"3f79a3b5_87fd143e","updated":"2018-10-19 11:59:49.000000000","message":"This probably should start with \u0027If the image status is not \"queued\" or values already exists,\u0027","commit_id":"6d6e036876850664098008768e53099ed375b034"},{"author":{"_account_id":23561,"name":"iain MacDonnell","email":"iain.macdonnell@oracle.com","username":"imacdonn"},"change_message_id":"2ef6af1c5e68def995a1f7fb2628221002b099f0","unresolved":false,"context_lines":[{"line_number":38,"context_line":"             \u0027validation_data\u0027: {"},{"line_number":39,"context_line":"                 \u0027description\u0027: _("},{"line_number":40,"context_line":"                     \u0027Values to be used to populate the corresponding \u0027"},{"line_number":41,"context_line":"                     \u0027image properties. If the image status is not \u0027"},{"line_number":42,"context_line":"                     \u0027\"queued\", values must exactly match those \u0027"},{"line_number":43,"context_line":"                     \u0027already contained in the image properties.\u0027"},{"line_number":44,"context_line":"                 ),"},{"line_number":45,"context_line":"                 \u0027type\u0027: \u0027object\u0027,"},{"line_number":46,"context_line":"                 \u0027writeOnly\u0027: True,"}],"source_content_type":"text/x-rst","patch_set":9,"id":"3f79a3b5_65b21499","line":43,"range":{"start_line":41,"start_character":40,"end_line":43,"end_character":64},"in_reply_to":"3f79a3b5_9bf236e4","updated":"2018-10-19 16:03:37.000000000","message":"Why should we care if values already exist, so long as the status is still \"queued\"? My current implementation doesn\u0027t check for that. I don\u0027t see any point in doing that.","commit_id":"6d6e036876850664098008768e53099ed375b034"},{"author":{"_account_id":23561,"name":"iain MacDonnell","email":"iain.macdonnell@oracle.com","username":"imacdonn"},"change_message_id":"40fe909b1145c516564391487bdb67e8feeab502","unresolved":false,"context_lines":[{"line_number":38,"context_line":"             \u0027validation_data\u0027: {"},{"line_number":39,"context_line":"                 \u0027description\u0027: _("},{"line_number":40,"context_line":"                     \u0027Values to be used to populate the corresponding \u0027"},{"line_number":41,"context_line":"                     \u0027image properties. If the image status is not \u0027"},{"line_number":42,"context_line":"                     \u0027\"queued\", values must exactly match those \u0027"},{"line_number":43,"context_line":"                     \u0027already contained in the image properties.\u0027"},{"line_number":44,"context_line":"                 ),"},{"line_number":45,"context_line":"                 \u0027type\u0027: \u0027object\u0027,"},{"line_number":46,"context_line":"                 \u0027writeOnly\u0027: True,"}],"source_content_type":"text/x-rst","patch_set":9,"id":"3f79a3b5_7aee0d8b","line":43,"range":{"start_line":41,"start_character":40,"end_line":43,"end_character":64},"in_reply_to":"3f79a3b5_d41cd815","updated":"2018-10-22 16:48:39.000000000","message":"I still need you guys to make a decision about whether or not the image status should be changed to \"active\" when \"locations\" gets updated. If that stays, this point is somewhat moot, since there will be no other way to get an image with status \"queued\" and values for checksum/multihash.\n\nI\u0027ve not seen anything to prevent updating the checksum - if I remove the line to update status on replace, I can do this:\n\n $ openstack image show -f value -c status -c checksum $IMAGEID\n443b7623e27ecf03dc9e01ee93f67afe\nqueued\n$ curl -g -i -X PATCH -H \u0027Accept-Encoding: gzip, deflate\u0027 -H \u0027Accept: */*\u0027 -H \u0027User-Agent: imacdonn-getting-dangerous\u0027 -H \"X-Auth-Token: ${TOKEN}\" -H \u0027Content-Type: application/openstack-images-v2.1-json-patch\u0027 -d \u0027[{\"op\":\"replace\", \"path\": \"/locations\", \"value\": [{\"url\": \"\u0027\"${IMAGEURL}\"\u0027\", \"metadata\": {}, \"validation_data\": {\"checksum\": \"0123456789abcdef0123456789abcdef\", \"os_hash_algo\": \"\u0027${OS_HASH_ALGO}\u0027\", \"os_hash_value\": \"\u0027${OS_HASH_VALUE}\u0027\"}}]}]\u0027 ${ENDPOINT}/v2/images/${IMAGEID}\nHTTP/1.1 200 OK\nContent-Length: 1206\nContent-Type: application/json\nX-Openstack-Request-Id: req-0cb005db-81ed-4d11-8838-cff7dd6c7a51\nDate: Mon, 22 Oct 2018 16:39:38 GMT\n\n{\"container_format\": \"bare\", \"min_ram\": 0, \"updated_at\": \"2018-10-22T16:39:39Z\", \"file\": \"/v2/images/59cb9bf9-95a8-4f9f-94c8-9a6a09157803/file\", \"owner\": \"c296e8e4cd9b44d1b81a4174e5504ce1\", \"id\": \"59cb9bf9-95a8-4f9f-94c8-9a6a09157803\", \"size\": 12716032, \"self\": \"/v2/images/59cb9bf9-95a8-4f9f-94c8-9a6a09157803\", \"disk_format\": \"qcow2\", \"os_hash_algo\": \"sha512\", \"direct_url\": \"http://slcop-deploy.us.oracle.com/glance-images/cirros.img\", \"schema\": \"/v2/schemas/image\", \"status\": \"queued\", \"tags\": [], \"visibility\": \"public\", \"locations\": [{\"url\": \"http://slcop-deploy.us.oracle.com/glance-images/cirros.img\", \"validation_data\": {\"checksum\": \"0123456789abcdef0123456789abcdef\", \"os_hash_algo\": \"sha512\", \"os_hash_value\": \"6513f21e44aa3da349f248188a44bc304a3653a04122d8fb4535423c8e1d14cd6a153f735bb0982e2161b5b5186106570c17a9e58b64dd39390617cd5a350f78\"}, \"metadata\": {}}], \"min_disk\": 0, \"virtual_size\": null, \"name\": \"cirros-test\", \"checksum\": \"0123456789abcdef0123456789abcdef\", \"created_at\": \"2018-10-22T16:38:28Z\", \"os_hidden\": false, \"protected\": false, \"os_hash_value\": \"6513f21e44aa3da349f248188a44bc304a3653a04122d8fb4535423c8e1d14cd6a153f735bb0982e2161b5b5186106570c17a9e58b64dd39390617cd5a350f78\"}$ \n$ openstack image show -f value -c status -c checksum $IMAGEID\n0123456789abcdef0123456789abcdef\nqueued\n$ \n\nBrian\u0027s understanding is correct - the validation_data is a NOOP if the image status is not queued, but it will be rejected if the values don\u0027t match the current ones. You can see the implementation of this at:\n\nhttps://review.openstack.org/#/c/597368/8/glance/api/v2/images.py\n\nlines 392-398","commit_id":"6d6e036876850664098008768e53099ed375b034"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"80b1aee7c005e0ba5b694efe32e75a7261941202","unresolved":false,"context_lines":[{"line_number":21,"context_line":"           image location. These values will be used to populate the"},{"line_number":22,"context_line":"           corresponding image properties."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"           New values for any of these items will only be accepted if the image"},{"line_number":25,"context_line":"           status is ``queued`` and the corresponding image property is not"},{"line_number":26,"context_line":"           already populated. To allow idempotency, this object may be included"},{"line_number":27,"context_line":"           when adding or replacing locations for an image which is in"},{"line_number":28,"context_line":"           ``active`` status or/and already has the corresponding properties"},{"line_number":29,"context_line":"           populated, but the supplied values must exactly match the existing"}],"source_content_type":"text/x-rst","patch_set":11,"id":"3f79a3b5_89b27b04","line":26,"range":{"start_line":24,"start_character":11,"end_line":26,"end_character":30},"updated":"2018-10-25 14:00:39.000000000","message":"This is just a note to myself.  The \"and\" here makes this feature set-once-only even if the queued -\u003e active status change when a location is added is reverted in master (which is a separate discussion).","commit_id":"b610a3693e1d706b5f903e4128e4f872deb7171d"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"db4e548f549b74a27739e8606986b2cb279deb5b","unresolved":false,"context_lines":[{"line_number":21,"context_line":"           image location. These values will be used to populate the"},{"line_number":22,"context_line":"           corresponding image properties."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"           New values for any of these items will only be accepted if the image"},{"line_number":25,"context_line":"           status is ``queued`` and the corresponding image property is not"},{"line_number":26,"context_line":"           already populated. To allow idempotency, this object may be included"},{"line_number":27,"context_line":"           when adding or replacing locations for an image which is in"},{"line_number":28,"context_line":"           ``active`` status or/and already has the corresponding properties"},{"line_number":29,"context_line":"           populated, but the supplied values must exactly match the existing"}],"source_content_type":"text/x-rst","patch_set":11,"id":"3f79a3b5_89aefb7d","line":26,"range":{"start_line":24,"start_character":11,"end_line":26,"end_character":30},"in_reply_to":"3f79a3b5_89b27b04","updated":"2018-10-25 14:06:01.000000000","message":"(I mean, \"added via PATCH op:replace\") :(","commit_id":"b610a3693e1d706b5f903e4128e4f872deb7171d"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"80b1aee7c005e0ba5b694efe32e75a7261941202","unresolved":false,"context_lines":[{"line_number":32,"context_line":"           The object may be included in one or more of the items in"},{"line_number":33,"context_line":"           a ``locations`` list, but values must be consistent across all"},{"line_number":34,"context_line":"           instances."},{"line_number":35,"context_line":"           "},{"line_number":36,"context_line":"           Although the ``validation_data`` object will be optional,"},{"line_number":37,"context_line":"           if it is present, the ``os_hash_algo`` and ``os_hash_value`` items"},{"line_number":38,"context_line":"           will be required, to force adoption of multihash. Since multihash"}],"source_content_type":"text/x-rst","patch_set":11,"id":"3f79a3b5_893d9b8e","line":35,"updated":"2018-10-25 14:00:39.000000000","message":"Might want to eliminate this whitespace if you have to put up a new revision.","commit_id":"b610a3693e1d706b5f903e4128e4f872deb7171d"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"5f44700adc38f20a23de24edad7d36b36f1d700f","unresolved":false,"context_lines":[{"line_number":37,"context_line":"           if it is present, the ``os_hash_algo`` and ``os_hash_value`` items"},{"line_number":38,"context_line":"           will be required, to force adoption of multihash. Since multihash"},{"line_number":39,"context_line":"           will be the default mechanism for clients in the Stein release,"},{"line_number":40,"context_line":"           ``checksum`` will be optional, but included to accommodate legacy"},{"line_number":41,"context_line":"           consumers that have not yet implemented multihash. The consumer"},{"line_number":42,"context_line":"           is expected know to to populate ``checksum`` only if their"},{"line_number":43,"context_line":"           deployment requires it."},{"line_number":44,"context_line":""}],"source_content_type":"text/x-rst","patch_set":12,"id":"3f79a3b5_e73888ee","line":41,"range":{"start_line":40,"start_character":11,"end_line":41,"end_character":61},"updated":"2018-10-31 18:56:00.000000000","message":"I\u0027ve been dragging my feet about checksum being optional, but I\u0027m OK with this.  TIL about FIPS-compliant python builds that do not include md5.  My reason for including the checksum was to have a backup in case the os_hash_algo wasn\u0027t available to the image consumer, but it turns out that there\u0027s no guarantee of md5 being available, either, so there\u0027s no point in requiring it.","commit_id":"b5391c5408929864a25ac9090a3f5e81e7e739e3"}]}
