Skip to content
This repository has been archived by the owner on Jun 14, 2021. It is now read-only.

Commit

Permalink
Merge pull request #346 from articulate/bugfix/sync-index-for-importe…
Browse files Browse the repository at this point in the history
…d-schemas

Ensure we sync schema index so it shows up in plan on import
  • Loading branch information
quantumew committed Nov 20, 2019
2 parents e41da80 + a6f13fe commit c7afeaa
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,3 +274,9 @@ BUG FIXES

* Schema merging helper function was mutating input schema causing side effects when used in a particular way. Used shallow copying to avoid this side effect. [GH-338]
* Ensure response is not nil when checking status code [GH-307]

## 3.0.37

BUG FIXES

* Ensure `index` is sync'd on import to avoid recreation.
5 changes: 4 additions & 1 deletion okta/resource_okta_user_base_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ func resourceUserBaseSchema() *schema.Resource {
Delete: resourceUserBaseSchemaDelete,
Exists: resourceUserBaseSchemaExists,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
State: func(d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error) {
d.Set("index", d.Id())
return []*schema.ResourceData{d}, nil
},
},

Schema: userBaseSchemaSchema,
Expand Down
5 changes: 4 additions & 1 deletion okta/resource_okta_user_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ func resourceUserSchema() *schema.Resource {
Delete: resourceUserSchemaDelete,
Exists: resourceUserSchemaExists,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
State: func(d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error) {
d.Set("index", d.Id())
return []*schema.ResourceData{d}, nil
},
},
Schema: userSchemaSchema,
}
Expand Down

0 comments on commit c7afeaa

Please sign in to comment.