Skip to content

Add tags and import support to service offerings; fix zone_ids handling - #314

Open
poddm wants to merge 6 commits into
apache:mainfrom
poddm:mp/service_zoneid_tags_clean
Open

Add tags and import support to service offerings; fix zone_ids handling#314
poddm wants to merge 6 commits into
apache:mainfrom
poddm:mp/service_zoneid_tags_clean

Conversation

@poddm

@poddm poddm commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Details

1. Add tags

  • Added a Tags field to the common service offering model
  • Added an optional tags attribute to the service offering schema
  • Added an applyTags helper that sets tags on the create params, wired into
    Create for all three service offering resources

2. Fix zone_ids handling

  • On read/update state (commonRead / commonUpdate), a returned zone id of
    "all" is no longer written into zone_ids; prior state is preserved so that
    a null or empty zone_ids (both meaning "all zones") doesn't produce a
    spurious diff
  • commonUpdateParams now correctly serializes domain_ids and zone_ids by
    joining the set elements with commas instead of using Set.String(), and
    defaults zoneid to "all" when none are set
  • commonCreateParams zone id handling cleaned up accordingly

3. Add import support

  • Implemented ImportState (via ImportStatePassthroughID on id) for the
    fixed, constrained, and unconstrained service offering resources
  • Added ImportState / ImportStateVerify steps to the acceptance tests for
    each resource

Files changed

  • cloudstack/service_offering_constrained_resource.go
  • cloudstack/service_offering_constrained_resource_test.go
  • cloudstack/service_offering_fixed_resource.go
  • cloudstack/service_offering_fixed_resource_test.go
  • cloudstack/service_offering_models.go
  • cloudstack/service_offering_schema.go
  • cloudstack/service_offering_unconstrained_resource.go
  • cloudstack/service_offering_unconstrained_resource_test.go
  • cloudstack/service_offering_util.go

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