Skip to content

Commit

Permalink
streamline create some more
Browse files Browse the repository at this point in the history
  • Loading branch information
rajagopalans committed Nov 21, 2023
1 parent d9772ff commit 753c149
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apstra/resource_datacenter_property_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,15 @@ func (o *resourceDatacenterPropertySet) Create(ctx context.Context, req resource
state.Keys = plan.Keys
state.SyncWithCatalog = plan.SyncWithCatalog
state.SyncRequired = types.BoolValue(false)

// If the keys are empty set the state and return.
if plan.Keys.IsNull() {
resp.Diagnostics.Append(resp.State.Set(ctx, &state)...)
return
}

// Stale is meaningless when the user has supplied keys
state.Stale = types.BoolNull()

// extract keys which actually got imported
var importedKeys []string
resp.Diagnostics.Append(plan.Keys.ElementsAs(ctx, &importedKeys, false)...)
Expand Down

0 comments on commit 753c149

Please sign in to comment.