Skip to content

Commit 7f87232

Browse files
committed
feat(gaudi-3):fixed review comments
1 parent f5f78ef commit 7f87232

12 files changed

+113
-110
lines changed

common/github.com/IBM/vpc-go-sdk/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/IBM/go-sdk-core/v5 v5.21.0
99
github.com/go-openapi/strfmt v0.23.0
1010
github.com/google/uuid v1.6.0
11-
github.com/stretchr/testify v1.10.0
11+
github.com/stretchr/testify v1.11.1
1212
)
1313

1414
require (

common/github.com/IBM/vpc-go-sdk/go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
6868
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
6969
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
7070
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
71+
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
72+
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
7173
go.mongodb.org/mongo-driver v1.14.0 h1:P98w8egYRjYe3XDjxhYJagTokP/H6HzlsnojRgZRd80=
7274
go.mongodb.org/mongo-driver v1.14.0/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c=
7375
go.mongodb.org/mongo-driver v1.17.2 h1:gvZyk8352qSfzyZ2UMWcpDpMSGEr1eqE4T793SqyhzM=

common/github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go

Lines changed: 88 additions & 88 deletions
Large diffs are not rendered by default.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ require (
5959
github.com/pkg/errors v0.9.1
6060
github.com/rook/rook/pkg/apis v0.0.0-20250619203122-80563e28b685
6161
github.com/softlayer/softlayer-go v1.0.3
62-
github.com/stretchr/testify v1.10.0
62+
github.com/stretchr/testify v1.11.1
6363
golang.org/x/crypto v0.38.0
6464
gopkg.in/yaml.v3 v3.0.1
6565
gotest.tools v2.2.0+incompatible

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,8 +1174,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o
11741174
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
11751175
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
11761176
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
1177-
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
1178-
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
1177+
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
1178+
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
11791179
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
11801180
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
11811181
github.com/tj/assert v0.0.0-20171129193455-018094318fb0/go.mod h1:mZ9/Rh9oLWpLLDRpvE+3b7gP/C2YyLFYxNmcLnPTMe0=

ibm/service/vpc/data_source_ibm_is_cluster_network_profiles.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func DataSourceIBMIsClusterNetworkProfiles() *schema.Resource {
111111
},
112112
},
113113
"isolation_group_count": &schema.Schema{
114-
Type: schema.TypeInt,
114+
Type: schema.TypeList,
115115
Computed: true,
116116
Description: "The number of isolation groups supported by this cluster network profile.",
117117
Elem: &schema.Resource{
@@ -243,7 +243,7 @@ func DataSourceIBMIsClusterNetworkProfilesClusterNetworkProfileToMap(model *vpcv
243243
if err != nil {
244244
return modelMap, err
245245
}
246-
modelMap["subnet_routing_supported"] = []map[string]interface{}{isolationGC}
246+
modelMap["isolation_group_count"] = []map[string]interface{}{isolationGC}
247247
}
248248

249249
zones := []map[string]interface{}{}

ibm/service/vpc/data_source_ibm_is_instance_profile.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,17 +1321,17 @@ func dataSourceInstanceProfileFlattenClusterNetworkAttachmentIsolationPolicy(res
13211321
return finalList
13221322
}
13231323

1324-
func dataSourceInstanceProfileClusterNetworkAttachmentIsolationPolicyToMap(vcpuArchitectureItem vpcv1.InstanceProfileClusterNetworkAttachmentIsolationPolicy) (vcpuArchitectureMap map[string]interface{}) {
1325-
vcpuArchitectureMap = map[string]interface{}{}
1324+
func dataSourceInstanceProfileClusterNetworkAttachmentIsolationPolicyToMap(clusterNetworkAttachmentCountPolicy vpcv1.InstanceProfileClusterNetworkAttachmentIsolationPolicy) (clusterNetworkAttachmentCountPolicyMap map[string]interface{}) {
1325+
clusterNetworkAttachmentCountPolicyMap = map[string]interface{}{}
13261326

1327-
if vcpuArchitectureItem.Type != nil {
1328-
vcpuArchitectureMap["type"] = vcpuArchitectureItem.Type
1327+
if clusterNetworkAttachmentCountPolicy.Type != nil {
1328+
clusterNetworkAttachmentCountPolicyMap["type"] = clusterNetworkAttachmentCountPolicy.Type
13291329
}
1330-
if vcpuArchitectureItem.Value != nil {
1331-
vcpuArchitectureMap["value"] = vcpuArchitectureItem.Value
1330+
if clusterNetworkAttachmentCountPolicy.Value != nil {
1331+
clusterNetworkAttachmentCountPolicyMap["value"] = clusterNetworkAttachmentCountPolicy.Value
13321332
}
13331333

1334-
return vcpuArchitectureMap
1334+
return clusterNetworkAttachmentCountPolicyMap
13351335
}
13361336

13371337
/* Changes for the AMD Support VCPU Manufacturer */

ibm/service/vpc/data_source_ibm_is_instance_profiles.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ func instanceProfilesList(context context.Context, d *schema.ResourceData, meta
875875
clusterNetworkAttachmentIsolationPolicy := profile.ClusterNetworkAttachmentIsolationPolicy.(*vpcv1.InstanceProfileClusterNetworkAttachmentIsolationPolicy)
876876
clusterNetworkAttachmentIsolationPolicyMap := dataSourceInstanceProfileClusterNetworkAttachmentIsolationPolicyToMap(*clusterNetworkAttachmentIsolationPolicy)
877877
clusterNetworkAttachmentIsolationPolicyList = append(clusterNetworkAttachmentIsolationPolicyList, clusterNetworkAttachmentIsolationPolicyMap)
878-
l["vcpu_architecture"] = clusterNetworkAttachmentIsolationPolicyList
878+
l["cluster_network_attachment_isolation_policy"] = clusterNetworkAttachmentIsolationPolicyList
879879
}
880880

881881
if profile.GpuCount != nil {

ibm/service/vpc/resource_ibm_is_cluster_network_subnet.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ func ResourceIBMIsClusterNetworkSubnet() *schema.Resource {
7979
"isolation_group": &schema.Schema{
8080
Type: schema.TypeInt,
8181
Optional: true,
82+
Computed: true,
8283
Description: "The isolation group for the cluster network subnet.The value will not be greater than the cluster network profile's isolation_group_count.",
8384
},
8485
"href": &schema.Schema{
@@ -414,7 +415,7 @@ func ResourceIBMIsClusterNetworkSubnetMapToClusterNetworkSubnetPrototype(modelMa
414415
model.Name = core.StringPtr(modelMap["name"].(string))
415416
}
416417
if modelMap["isolation_group"] != nil && modelMap["isolation_group"].(string) != "" {
417-
model.Name = core.StringPtr(modelMap["isolation_group"].(string))
418+
model.IsolationGroup = core.Int64Ptr(int64(modelMap["isolation_group"].(int)))
418419
}
419420
if modelMap["total_ipv4_address_count"] != nil {
420421
model.TotalIpv4AddressCount = core.Int64Ptr(int64(modelMap["total_ipv4_address_count"].(int)))

ibm/service/vpc/resource_ibm_is_cluster_network_subnet_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ func TestAccIBMIsClusterNetworkSubnetBasic(t *testing.T) {
2121
var conf vpcv1.ClusterNetworkSubnet
2222
vpcname := fmt.Sprintf("tf-vpc-%d", acctest.RandIntRange(10, 100))
2323
totalipv4addresscount := int64(64)
24+
isolationGroup := int64(64)
2425
resource.Test(t, resource.TestCase{
2526
PreCheck: func() { acc.TestAccPreCheck(t) },
2627
Providers: acc.TestAccProviders,
2728
CheckDestroy: testAccCheckIBMIsClusterNetworkSubnetDestroy,
2829
Steps: []resource.TestStep{
2930
resource.TestStep{
30-
Config: testAccCheckIBMIsClusterNetworkSubnetConfigBasic(vpcname, totalipv4addresscount),
31+
Config: testAccCheckIBMIsClusterNetworkSubnetConfigBasic(vpcname, totalipv4addresscount, isolationGroup),
3132
Check: resource.ComposeAggregateTestCheckFunc(
3233
testAccCheckIBMIsClusterNetworkSubnetExists("ibm_is_cluster_network_subnet.is_cluster_network_subnet_instance", conf),
3334
resource.TestCheckResourceAttr("ibm_is_vpc.is_vpc", "name", vpcname),
@@ -142,7 +143,7 @@ func TestAccIBMIsClusterNetworkSubnetBasicAllArgs(t *testing.T) {
142143
})
143144
}
144145

145-
func testAccCheckIBMIsClusterNetworkSubnetConfigBasic(vpcname string, totalipv4addresscount int64) string {
146+
func testAccCheckIBMIsClusterNetworkSubnetConfigBasic(vpcname string, totalipv4addresscount int64, isolationGroup int64) string {
146147
return fmt.Sprintf(`
147148
resource "ibm_is_vpc" "is_vpc" {
148149
name = "%s"
@@ -159,7 +160,7 @@ func testAccCheckIBMIsClusterNetworkSubnetConfigBasic(vpcname string, totalipv4a
159160
total_ipv4_address_count = %d
160161
isolation_group = %d
161162
}
162-
`, vpcname, acc.ISClusterNetworkProfileName, acc.ISZoneName, totalipv4addresscount)
163+
`, vpcname, acc.ISClusterNetworkProfileName, acc.ISZoneName, totalipv4addresscount, isolationGroup)
163164
}
164165

165166
func testAccCheckIBMIsClusterNetworkSubnetConfig(vpcname, subnetname1, subnetname2 string, totalIpv4AddressCount int64) string {

0 commit comments

Comments
 (0)