Skip to content

Commit

Permalink
ignore min_cpu_platform change from null to Intel/Auto (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangrzneu authored Feb 26, 2024
1 parent a2bbcda commit aa70aaf
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
6 changes: 6 additions & 0 deletions ucloud/resource_ucloud_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
6 changes: 6 additions & 0 deletions ucloud/resource_ucloud_uk8s_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 9 additions & 1 deletion ucloud/resource_ucloud_uk8s_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit aa70aaf

Please sign in to comment.