55 "fmt"
66 "log"
77 "regexp"
8- "strings"
98 "time"
109
1110 "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
@@ -284,21 +283,13 @@ func suppressStorageDiff(k, old, new string, d *schema.ResourceData) bool {
284283 return false
285284}
286285
287- func AutoscaleModeDiffSuppress (k , old , new string , d * schema.ResourceData ) bool {
288- if strings .EqualFold (old , new ) {
289- log .Printf ("[INFO] Suppressing diff on autoscale mode" )
290- return true
291- }
292- return false
293- }
294-
295286func adjustPipelineResourceSchema (m map [string ]* schema.Schema ) map [string ]* schema.Schema {
296287 cluster , _ := m ["cluster" ].Elem .(* schema.Resource )
297288 clustersSchema := cluster .Schema
298289 clustersSchema ["spark_conf" ].DiffSuppressFunc = clusters .SparkConfDiffSuppressFunc
299290 common .MustSchemaPath (clustersSchema ,
300291 "aws_attributes" , "zone_id" ).DiffSuppressFunc = clusters .ZoneDiffSuppress
301- common .MustSchemaPath (clustersSchema , "autoscale" , "mode" ).DiffSuppressFunc = AutoscaleModeDiffSuppress
292+ common .MustSchemaPath (clustersSchema , "autoscale" , "mode" ).DiffSuppressFunc = common . EqualFoldDiffSuppress
302293
303294 gcpAttributes , _ := clustersSchema ["gcp_attributes" ].Elem .(* schema.Resource )
304295 gcpAttributesSchema := gcpAttributes .Schema
@@ -312,6 +303,7 @@ func adjustPipelineResourceSchema(m map[string]*schema.Schema) map[string]*schem
312303 }
313304 m ["channel" ].ValidateFunc = validation .StringInSlice ([]string {"current" , "preview" }, true )
314305 m ["edition" ].ValidateFunc = validation .StringInSlice ([]string {"pro" , "core" , "advanced" }, true )
306+ m ["edition" ].DiffSuppressFunc = common .EqualFoldDiffSuppress
315307
316308 m ["storage" ].DiffSuppressFunc = suppressStorageDiff
317309 m ["storage" ].ConflictsWith = []string {"catalog" }
0 commit comments