Skip to content

Adding zoneid and tags - #9

Open
poddm wants to merge 5 commits into
mainfrom
mp/service_zoneid_tags
Open

Adding zoneid and tags#9
poddm wants to merge 5 commits into
mainfrom
mp/service_zoneid_tags

Conversation

@poddm

@poddm poddm commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Add tags field and fix zone_ids handling for service offerings

Summary

This PR adds a tags attribute to the service offering resources and fixes a bug where zone_ids was incorrectly overwritten when the CloudStack API returned "all" as the zone ID.

Changes

New tags field

  • Added tags as an optional StringAttribute to the common service offering schema
  • Added Tags field to serviceOfferingCommonResourceModel
  • Added applyTags() helper that sets tags on CreateServiceOfferingParams when non-null
  • Affects all three resource types: fixed, constrained, and unconstrained

Fix zone_ids state management

  • commonRead and commonUpdate now skip overwriting ZoneIds when the API returns "all" or an empty string — previously this would replace a null/empty plan value with ["all"], causing a perpetual diff
  • commonUpdateParams and commonCreateParams: extracted zoneIDs local variable for clarity; no behavioral change

Files Changed

File Change
service_offering_models.go Add Tags field
service_offering_schema.go Add tags schema attribute
service_offering_util.go Fix zone_ids "all" handling; add applyTags()
service_offering_{fixed,constrained,unconstrained}_resource.go Wire up new field

@poddm
poddm force-pushed the mp/service_zoneid_tags branch from 0e51815 to 50bc506 Compare August 7, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant