Skip to content

Commit aa70aaf

Browse files
authored
ignore min_cpu_platform change from null to Intel/Auto (#162)
1 parent a2bbcda commit aa70aaf

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

ucloud/resource_ucloud_instance.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,12 @@ func resourceUCloudInstance() *schema.Resource {
292292
Optional: true,
293293
ForceNew: true,
294294
Default: "Intel/Auto",
295+
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
296+
if old == "" && new == "Intel/Auto" {
297+
return true
298+
}
299+
return false
300+
},
295301
},
296302

297303
"cpu_platform": {

ucloud/resource_ucloud_uk8s_cluster.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,12 @@ func resourceUCloudUK8SCluster() *schema.Resource {
202202
Optional: true,
203203
ForceNew: true,
204204
Default: "Intel/Auto",
205+
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
206+
if old == "" && new == "Intel/Auto" {
207+
return true
208+
}
209+
return false
210+
},
205211
ValidateFunc: validation.StringInSlice([]string{
206212
"Intel/Auto",
207213
"Intel/IvyBridge",

ucloud/resource_ucloud_uk8s_node.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ package ucloud
33
import (
44
"encoding/base64"
55
"fmt"
6-
"github.com/hashicorp/terraform-plugin-sdk/helper/customdiff"
76
"strings"
87
"time"
98

9+
"github.com/hashicorp/terraform-plugin-sdk/helper/customdiff"
10+
1011
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
1112
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
1213
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
@@ -170,6 +171,13 @@ func resourceUCloudUK8SNode() *schema.Resource {
170171
Type: schema.TypeString,
171172
Optional: true,
172173
ForceNew: true,
174+
Default: "Intel/Auto",
175+
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
176+
if old == "" && new == "Intel/Auto" {
177+
return true
178+
}
179+
return false
180+
},
173181
ValidateFunc: validation.StringInSlice([]string{
174182
"Intel/Auto",
175183
"Intel/IvyBridge",

0 commit comments

Comments
 (0)