forked from GoogleCloudPlatform/magic-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for accelerators to google_datafusion_instance (GoogleClo…
…udPlatform#6851) Added support to the field for Data Fusion, updated corresponding generated and handwritten tests, and added a custom diffsuppressfunc. Currently suggests a manual fix to a potential diff issue, will be able to update down line based on feedback from API team.
- Loading branch information
1 parent
f7f3408
commit 834b723
Showing
5 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
mmv1/templates/terraform/constants/data_fusion_instance_option.go.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
var instanceAcceleratorOptions = []string{ | ||
"delta.default.checkpoint.directory", | ||
"ui.feature.cdc", | ||
} | ||
|
||
func instanceOptionsDiffSuppress(k, old, new string, d *schema.ResourceData) bool { | ||
// Suppress diffs for the options generated by adding an accelerator to a data fusion instance | ||
for _, option := range instanceAcceleratorOptions { | ||
if strings.Contains(k, option) && new == "" { | ||
return true | ||
} | ||
} | ||
|
||
// Let diff be determined by options (above) | ||
if strings.Contains(k, "options.%") { | ||
return true | ||
} | ||
|
||
// For other keys, don't suppress diff. | ||
return false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters