feat(images): settable custom image properties - #13
Merged
Conversation
Make the pcd_images_image `properties` map user-settable (Optional+Computed). User-defined key/value metadata is set on create via images.CreateOpts.Properties and reconciled on update as a JSON-patch (add/replace/remove) built from the plan-vs-state diff. Read is echo-only: Glance returns dozens of system/read-only properties (os_hash_*, stores, direct_url, owner_specified.*, ...) via RemainingKeys, so flatten tracks only the keys the user manages, with a system-property deny-list as a second guard. This prevents a perpetual plan diff and avoids attempts to patch read-only properties. Acceptance test extended to cover add/replace/remove and the import quirk. build/vet/gofmt/golangci-lint and tfplugindocs all clean.
The isSystemImageProperty deny-list was applied on top of the managed-key filter in flatten, but the managed set already restricts tracking to keys the user configured — so the deny-list added no leak protection and instead stripped legitimate user properties whose names collide with it (e.g. "location", "size"). That produced an 'inconsistent result after apply' error. Track by the managed set alone and drop the unused deny-list. Found by adversarial review.
PF9-pushkar
added a commit
that referenced
this pull request
Jul 14, 2026
feat(images): settable custom image properties
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #2 (Phase 1 follow-ups). Makes
pcd_images_image.propertiesuser-settable (was read-only).images.CreateOpts.Properties; reconciled on update as a JSON-patch (add/replace/remove) from the plan-vs-state diff.os_hash_*,stores,direct_url,owner_specified.*, …) viaRemainingKeys. Read tracks only the keys the user manages, preventing a perpetual plan diff and any attempt to patch read-only properties.Adversarial review fix included: dropped a system-property deny-list that was applied on top of the managed-key filter — it added no protection (the managed set already restricts to user keys) but wrongly stripped legitimate user properties whose names collide with it (e.g.
location,size), which would have caused an "inconsistent result after apply" error.build / vet / gofmt / golangci-lint (0 issues) / tfplugindocs all clean.