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.
fixed permadiffs on
environment_variables
in cloudfunctions2 functi…
- Loading branch information
1 parent
080796a
commit c57a512
Showing
2 changed files
with
16 additions
and
0 deletions.
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
14 changes: 14 additions & 0 deletions
14
mmv1/templates/terraform/constants/cloudfunctions2_function.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,14 @@ | ||
// Suppress diffs for the system environment variables | ||
func environmentVariablesDiffSuppress(k, old, new string, d *schema.ResourceData) bool { | ||
if k == "service_config.0.environment_variables.LOG_EXECUTION_ID" && new == "" { | ||
return true | ||
} | ||
|
||
// Let diff be determined by environment_variables (above) | ||
if strings.HasPrefix(k, "service_config.0.environment_variables.%") { | ||
return true | ||
} | ||
|
||
// For other keys, don't suppress diff. | ||
return false | ||
} |