Skip to content

Commit 8d4ea80

Browse files
authored
fix(k8s): fix K8SCluster_PrivateNetwork test 2 (#1884)
1 parent 9d19b28 commit 8d4ea80

File tree

2 files changed

+92
-93
lines changed

2 files changed

+92
-93
lines changed

scaleway/resource_k8s_cluster_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package scaleway
22

33
import (
44
"fmt"
5-
"strings"
65
"testing"
76

87
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
@@ -516,16 +515,16 @@ func testAccCheckScalewayK8sClusterPrivateNetworkID(tt *TestTools, clusterName,
516515
return fmt.Errorf("resource not found: %s", pnName)
517516
}
518517

519-
_, zone, pnID, err := vpcAPIWithZoneAndID(tt.Meta, rs.Primary.ID)
518+
_, _, pnID, err := vpcAPIWithZoneAndID(tt.Meta, rs.Primary.ID)
520519
if err != nil {
521520
return err
522521
}
523522

524523
if clusterPNID == nil {
525-
return fmt.Errorf("expected %s private_network_id to be %s, got nil", clusterName, strings.TrimLeft(pnID, zone.String()+"/"))
524+
return fmt.Errorf("expected %s private_network_id to be %s, got nil", clusterName, pnID)
526525
}
527-
if *clusterPNID != strings.TrimLeft(pnID, zone.String()+"/") {
528-
return fmt.Errorf("expected %s private_network_id to be %s, got %s", clusterName, strings.TrimLeft(pnID, zone.String()+"/"), *clusterPNID)
526+
if *clusterPNID != pnID {
527+
return fmt.Errorf("expected %s private_network_id to be %s, got %s", clusterName, pnID, *clusterPNID)
529528
}
530529

531530
return nil

0 commit comments

Comments
 (0)