Skip to content

Commit

Permalink
DRY'd up to utils
Browse files Browse the repository at this point in the history
  • Loading branch information
monde committed May 12, 2022
1 parent 723e114 commit b5cdc5d
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions okta/brand.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var brandResourceSchema = map[string]*schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Custom privacy policy URL",
DiffSuppressFunc: suppressDuringCreate,
DiffSuppressFunc: suppressDuringCreateFunc("brand_id"),
},
"links": {
Type: schema.TypeString,
Expand All @@ -40,18 +40,10 @@ var brandResourceSchema = map[string]*schema.Schema{
Optional: true,
Default: false,
Description: `Removes "Powered by Okta" from the Okta-hosted sign-in page and "© 2021 Okta, Inc." from the Okta End-User Dashboard`,
DiffSuppressFunc: suppressDuringCreate,
DiffSuppressFunc: suppressDuringCreateFunc("brand_id"),
},
}

func suppressDuringCreate(k, old, new string, d *schema.ResourceData) bool {
// If brand_id has changed assume this is create and treat the properties as readers not caring about what would otherwise apear to be drift.
if d.HasChange("brand_id") {
return true
}
return old == new
}

var brandDataSourceSchema = map[string]*schema.Schema{
"id": {
Type: schema.TypeString,
Expand Down

0 comments on commit b5cdc5d

Please sign in to comment.