Skip to content

Commit d45e88c

Browse files
authored
chore: fix bugs (#711)
Signed-off-by: Patrik Cyvoct <[email protected]>
1 parent 5e5cd10 commit d45e88c

8 files changed

+15
-16
lines changed

scaleway/resource_baremetal_server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func resourceScalewayBaremetalServerCreate(d *schema.ResourceData, m interface{}
138138
server, err := baremetalAPI.CreateServer(&baremetal.CreateServerRequest{
139139
Zone: zone,
140140
Name: expandOrGenerateString(d.Get("name"), "bm"),
141-
OrganizationID: scw.StringPtr(d.Get("organization_id").(string)),
141+
OrganizationID: expandStringPtr(d.Get("organization_id").(string)),
142142
Description: d.Get("description").(string),
143143
OfferID: offerID.ID,
144144
Tags: expandStrings(d.Get("tags")),

scaleway/resource_k8s_cluster_beta.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ func resourceScalewayK8SClusterBetaCreate(d *schema.ResourceData, m interface{})
357357

358358
req := &k8s.CreateClusterRequest{
359359
Region: region,
360-
OrganizationID: scw.StringPtr(d.Get("organization_id").(string)),
360+
OrganizationID: expandStringPtr(d.Get("organization_id").(string)),
361361
Name: expandOrGenerateString(d.Get("name"), "cluster"),
362362
Description: description.(string),
363363
Cni: k8s.CNI(d.Get("cni").(string)),

scaleway/resource_lb_beta.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func resourceScalewayLbBetaCreate(d *schema.ResourceData, m interface{}) error {
6767
createReq := &lb.CreateLBRequest{
6868
Region: region,
6969
IPID: scw.StringPtr(expandID(d.Get("ip_id").(string))),
70-
OrganizationID: scw.StringPtr(d.Get("organization_id").(string)),
70+
OrganizationID: expandStringPtr(d.Get("organization_id").(string)),
7171
Name: expandOrGenerateString(d.Get("name"), "lb"),
7272
Type: d.Get("type").(string),
7373
}

scaleway/resource_lb_beta_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ func testSweepLB(region string) error {
2525
lbAPI := lb.NewAPI(scwClient)
2626

2727
l.Debugf("sweeper: destroying the lbs in (%s)", region)
28-
listLBs, err := lbAPI.ListLbs(&lb.ListLbsRequest{}, scw.WithAllPages())
28+
listLBs, err := lbAPI.ListLBs(&lb.ListLBsRequest{}, scw.WithAllPages())
2929
if err != nil {
3030
return fmt.Errorf("error listing lbs in (%s) in sweeper: %s", region, err)
3131
}
3232

33-
for _, l := range listLBs.Lbs {
34-
err := lbAPI.DeleteLb(&lb.DeleteLbRequest{
35-
LbID: l.ID,
33+
for _, l := range listLBs.LBs {
34+
err := lbAPI.DeleteLB(&lb.DeleteLBRequest{
35+
LBID: l.ID,
3636
ReleaseIP: true,
3737
})
3838
if err != nil {
@@ -94,8 +94,8 @@ func testAccCheckScalewayLbBetaExists(n string) resource.TestCheckFunc {
9494
return err
9595
}
9696

97-
_, err = lbAPI.GetLb(&lb.GetLbRequest{
98-
LbID: ID,
97+
_, err = lbAPI.GetLB(&lb.GetLBRequest{
98+
LBID: ID,
9999
Region: region,
100100
})
101101

@@ -118,9 +118,9 @@ func testAccCheckScalewayLbBetaDestroy(s *terraform.State) error {
118118
return err
119119
}
120120

121-
_, err = lbAPI.GetLb(&lb.GetLbRequest{
121+
_, err = lbAPI.GetLB(&lb.GetLBRequest{
122122
Region: region,
123-
LbID: ID,
123+
LBID: ID,
124124
})
125125

126126
// If no error resource still exist

scaleway/resource_lb_ip_beta.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package scaleway
33
import (
44
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
55
lb "github.com/scaleway/scaleway-sdk-go/api/lb/v1"
6-
"github.com/scaleway/scaleway-sdk-go/scw"
76
)
87

98
func resourceScalewayLbIPBeta() *schema.Resource {
@@ -48,7 +47,7 @@ func resourceScalewayLbIPBetaCreate(d *schema.ResourceData, m interface{}) error
4847

4948
createReq := &lb.CreateIPRequest{
5049
Region: region,
51-
OrganizationID: scw.StringPtr(d.Get("organization_id").(string)),
50+
OrganizationID: expandStringPtr(d.Get("organization_id").(string)),
5251
Reverse: expandStringPtr(d.Get("reverse")),
5352
}
5453

scaleway/resource_lb_ip_beta_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func testSweepLBIP(region string) error {
3131
}
3232

3333
for _, ip := range listIPs.IPs {
34-
if ip.LbID == nil {
34+
if ip.LBID == nil {
3535
err := lbAPI.ReleaseIP(&lb.ReleaseIPRequest{
3636
IPID: ip.ID,
3737
})

scaleway/resource_rdb_instance_beta.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func resourceScalewayRdbInstanceBetaCreate(d *schema.ResourceData, m interface{}
126126

127127
createReq := &rdb.CreateInstanceRequest{
128128
Region: region,
129-
OrganizationID: scw.StringPtr(d.Get("organization_id").(string)),
129+
OrganizationID: expandStringPtr(d.Get("organization_id").(string)),
130130
Name: expandOrGenerateString(d.Get("name"), "rdb"),
131131
NodeType: d.Get("node_type").(string),
132132
Engine: d.Get("engine").(string),

scaleway/resource_registry_namespace_beta.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func resourceScalewayRegistryNamespaceBetaCreate(d *schema.ResourceData, m inter
5252

5353
ns, err := api.CreateNamespace(&registry.CreateNamespaceRequest{
5454
Region: region,
55-
OrganizationID: scw.StringPtr(d.Get("organization_id").(string)),
55+
OrganizationID: expandStringPtr(d.Get("organization_id").(string)),
5656
Name: d.Get("name").(string),
5757
Description: d.Get("description").(string),
5858
IsPublic: d.Get("is_public").(bool),

0 commit comments

Comments
 (0)