diff --git a/ucloud/resource_ucloud_instance.go b/ucloud/resource_ucloud_instance.go index 3a75e5f6..226ed205 100644 --- a/ucloud/resource_ucloud_instance.go +++ b/ucloud/resource_ucloud_instance.go @@ -292,6 +292,12 @@ func resourceUCloudInstance() *schema.Resource { Optional: true, ForceNew: true, Default: "Intel/Auto", + DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { + if old == "" && new == "Intel/Auto" { + return true + } + return false + }, }, "cpu_platform": { diff --git a/ucloud/resource_ucloud_uk8s_cluster.go b/ucloud/resource_ucloud_uk8s_cluster.go index 6cc5b099..4071faab 100644 --- a/ucloud/resource_ucloud_uk8s_cluster.go +++ b/ucloud/resource_ucloud_uk8s_cluster.go @@ -202,6 +202,12 @@ func resourceUCloudUK8SCluster() *schema.Resource { Optional: true, ForceNew: true, Default: "Intel/Auto", + DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { + if old == "" && new == "Intel/Auto" { + return true + } + return false + }, ValidateFunc: validation.StringInSlice([]string{ "Intel/Auto", "Intel/IvyBridge", diff --git a/ucloud/resource_ucloud_uk8s_node.go b/ucloud/resource_ucloud_uk8s_node.go index 3bacb88f..e6cbf40a 100644 --- a/ucloud/resource_ucloud_uk8s_node.go +++ b/ucloud/resource_ucloud_uk8s_node.go @@ -3,10 +3,11 @@ package ucloud import ( "encoding/base64" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/helper/customdiff" "strings" "time" + "github.com/hashicorp/terraform-plugin-sdk/helper/customdiff" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" @@ -170,6 +171,13 @@ func resourceUCloudUK8SNode() *schema.Resource { Type: schema.TypeString, Optional: true, ForceNew: true, + Default: "Intel/Auto", + DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { + if old == "" && new == "Intel/Auto" { + return true + } + return false + }, ValidateFunc: validation.StringInSlice([]string{ "Intel/Auto", "Intel/IvyBridge",