Skip to content

Commit

Permalink
add comments explaining use of CustomizeDiff
Browse files Browse the repository at this point in the history
  • Loading branch information
jedelson-pagerduty committed Feb 14, 2023
1 parent fd7355d commit f850d9b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pagerduty/resource_pagerduty_custom_field_option.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ func resourcePagerDutyCustomFieldOption() *schema.Resource {
UpdateContext: resourcePagerDutyCustomFieldOptionUpdate,
DeleteContext: resourcePagerDutyCustomFieldOptionDelete,
CreateContext: resourcePagerDutyCustomFieldOptionCreate,
// this function does not actually customize the diff but uses this hook
// to validate the combination of datatype and value.
CustomizeDiff: validateCustomFieldOptionValue,
Schema: map[string]*schema.Schema{
"field": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ func resourcePagerDutyCustomFieldSchemaFieldConfiguration() *schema.Resource {
UpdateContext: resourcePagerDutyCustomFieldSchemaFieldConfigurationUpdate,
DeleteContext: resourcePagerDutyCustomFieldSchemaFieldConfigurationDelete,
CreateContext: resourcePagerDutyCustomFieldSchemaFieldConfigurationCreate,
// this function does not actually customize the diff but uses this hook
// to validate the combination of required and the default_value prefixed
// attributes
CustomizeDiff: validateCustomFieldsForSchema,
Schema: map[string]*schema.Schema{
"schema": {
Expand Down

0 comments on commit f850d9b

Please sign in to comment.