Skip to content

Commit

Permalink
Fix/tests v6 (#61)
Browse files Browse the repository at this point in the history
changed k8s_version from tests to 1.20.8
  • Loading branch information
iblindu authored Jul 21, 2021
1 parent 01a9618 commit 8fd48da
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
10 changes: 5 additions & 5 deletions ionoscloud/data_source_k8s_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestAccDataSourceK8sCluster_matchId(t *testing.T) {
Config: testAccDataSourceProfitBricksK8sClusterMatchId,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("data.ionoscloud_k8s_cluster.test_ds_k8s_cluster", "name", "test_cluster"),
resource.TestCheckResourceAttr("data.ionoscloud_k8s_cluster.test_ds_k8s_cluster", "k8s_version", "1.20.6"),
resource.TestCheckResourceAttr("data.ionoscloud_k8s_cluster.test_ds_k8s_cluster", "k8s_version", "1.20.8"),
resource.TestCheckResourceAttrSet("data.ionoscloud_k8s_cluster.test_ds_k8s_cluster", "kube_config"),
),
},
Expand All @@ -44,7 +44,7 @@ func TestAccDataSourceK8sCluster_matchName(t *testing.T) {
Config: testAccDataSourceProfitBricksK8sClusterMatchName,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("data.ionoscloud_k8s_cluster.test_ds_k8s_cluster", "name", "test_cluster"),
resource.TestCheckResourceAttr("data.ionoscloud_k8s_cluster.test_ds_k8s_cluster", "k8s_version", "1.20.6"),
resource.TestCheckResourceAttr("data.ionoscloud_k8s_cluster.test_ds_k8s_cluster", "k8s_version", "1.20.8"),
resource.TestCheckResourceAttrSet("data.ionoscloud_k8s_cluster.test_ds_k8s_cluster", "kube_config"),
resource.TestCheckResourceAttrSet("data.ionoscloud_k8s_cluster.test_ds_k8s_cluster", "id"),
),
Expand All @@ -57,14 +57,14 @@ func TestAccDataSourceK8sCluster_matchName(t *testing.T) {
const testAccDataSourceProfitBricksK8sClusterCreateResources = `
resource "ionoscloud_k8s_cluster" "test_ds_k8s_cluster" {
name = "test_cluster"
k8s_version = "1.20.6"
k8s_version = "1.20.8"
}
`

const testAccDataSourceProfitBricksK8sClusterMatchId = `
resource "ionoscloud_k8s_cluster" "test_ds_k8s_cluster" {
name = "test_cluster"
k8s_version = "1.20.6"
k8s_version = "1.20.8"
}
data "ionoscloud_k8s_cluster" "test_ds_k8s_cluster" {
Expand All @@ -75,7 +75,7 @@ data "ionoscloud_k8s_cluster" "test_ds_k8s_cluster" {
const testAccDataSourceProfitBricksK8sClusterMatchName = `
resource "ionoscloud_k8s_cluster" "test_ds_k8s_cluster" {
name = "test_cluster"
k8s_version = "1.20.6"
k8s_version = "1.20.8"
}
data "ionoscloud_k8s_cluster" "test_ds_k8s_cluster" {
Expand Down
10 changes: 5 additions & 5 deletions ionoscloud/data_source_k8s_node_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestAccDataSourceK8sNodePool_matchId(t *testing.T) {
Config: testAccDataSourceProfitBricksK8sNodePoolMatchId,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("data.ionoscloud_k8s_node_pool.test_ds_k8s_node_pool", "name", "test_nodepool"),
resource.TestCheckResourceAttr("data.ionoscloud_k8s_node_pool.test_ds_k8s_node_pool", "k8s_version", "1.20.6"),
resource.TestCheckResourceAttr("data.ionoscloud_k8s_node_pool.test_ds_k8s_node_pool", "k8s_version", "1.20.8"),
),
},
},
Expand All @@ -43,7 +43,7 @@ func TestAccDataSourceK8sNodePool_matchName(t *testing.T) {
Config: testAccDataSourceProfitBricksK8sNodePoolMatchName,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("data.ionoscloud_k8s_node_pool.test_ds_k8s_node_pool", "name", "test_nodepool"),
resource.TestCheckResourceAttr("data.ionoscloud_k8s_node_pool.test_ds_k8s_node_pool", "k8s_version", "1.20.6"),
resource.TestCheckResourceAttr("data.ionoscloud_k8s_node_pool.test_ds_k8s_node_pool", "k8s_version", "1.20.8"),
resource.TestCheckResourceAttrSet("data.ionoscloud_k8s_node_pool.test_ds_k8s_node_pool", "id"),
),
},
Expand Down Expand Up @@ -75,7 +75,7 @@ resource "ionoscloud_k8s_node_pool" "test_ds_k8s_node_pool" {
availability_zone = "AUTO"
storage_type = "HDD"
storage_size = 15
k8s_version = "1.20.6"
k8s_version = "1.20.8"
}
`

Expand All @@ -102,7 +102,7 @@ resource "ionoscloud_k8s_node_pool" "test_ds_k8s_node_pool" {
availability_zone = "AUTO"
storage_type = "HDD"
storage_size = 15
k8s_version = "1.20.6"
k8s_version = "1.20.8"
# public_ips = [ "158.222.102.239", "158.222.102.241", "158.222.102.242" ]
# public_ips = [ ]
# public_ips = [ ]
Expand Down Expand Up @@ -137,7 +137,7 @@ resource "ionoscloud_k8s_node_pool" "test_ds_k8s_node_pool" {
availability_zone = "AUTO"
storage_type = "HDD"
storage_size = 15
k8s_version = "1.20.6"
k8s_version = "1.20.8"
# public_ips = [ "158.222.102.239", "158.222.102.241", "158.222.102.242" ]
# public_ips = [ ]
# public_ips = [ ]
Expand Down
4 changes: 2 additions & 2 deletions ionoscloud/resource_k8s_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func testAccCheckk8sClusterExists(n string, k8sCluster *ionoscloud.KubernetesClu
const testAccCheckk8sClusterConfigBasic = `
resource "ionoscloud_k8s_cluster" "example" {
name = "%s"
k8s_version = "1.20.6"
k8s_version = "1.20.8"
maintenance_window {
day_of_the_week = "Sunday"
time = "09:00:00Z"
Expand All @@ -157,7 +157,7 @@ resource "ionoscloud_k8s_cluster" "example" {
const testAccCheckk8sClusterConfigUpdate = `
resource "ionoscloud_k8s_cluster" "example" {
name = "updated"
k8s_version = "1.20.6"
k8s_version = "1.20.8"
maintenance_window {
day_of_the_week = "Monday"
time = "10:30:00Z"
Expand Down
12 changes: 6 additions & 6 deletions ionoscloud/resource_k8s_node_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,8 @@ func resourcek8sNodePoolRead(ctx context.Context, d *schema.ResourceData, meta i

nodePoolLans := make([]interface{}, 0)
if k8sNodepool.Properties.Lans != nil && len(*k8sNodepool.Properties.Lans) > 0 {
nodePoolLans = make([]interface{}, len(*k8sNodepool.Properties.Lans))
for lanIndex, nodePoolLan := range *k8sNodepool.Properties.Lans {
nodePoolLans = make([]interface{}, 0)
for _, nodePoolLan := range *k8sNodepool.Properties.Lans {
lanEntry := make(map[string]interface{})

if nodePoolLan.Id != nil {
Expand All @@ -554,24 +554,24 @@ func resourcek8sNodePoolRead(ctx context.Context, d *schema.ResourceData, meta i

nodePoolRoutes := make([]interface{}, 0)
if nodePoolLan.Routes != nil && len(*nodePoolLan.Routes) > 0 {
nodePoolRoutes = make([]interface{}, len(*nodePoolLan.Routes))
for routeIndex, nodePoolRoute := range *nodePoolLan.Routes {
nodePoolRoutes = make([]interface{}, 0)
for _, nodePoolRoute := range *nodePoolLan.Routes {
routeEntry := make(map[string]string)
if nodePoolRoute.Network != nil {
routeEntry["network"] = *nodePoolRoute.Network
}
if nodePoolRoute.GatewayIp != nil {
routeEntry["gateway_ip"] = *nodePoolRoute.GatewayIp
}
nodePoolRoutes[routeIndex] = routeEntry
nodePoolRoutes = append(nodePoolRoutes, routeEntry)
}
}

if len(nodePoolRoutes) > 0 {
lanEntry["routes"] = nodePoolRoutes
}

nodePoolLans[lanIndex] = lanEntry
nodePoolLans = append(nodePoolLans, lanEntry)
}
}

Expand Down
8 changes: 4 additions & 4 deletions ionoscloud/resource_k8s_node_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ resource "ionoscloud_datacenter" "terraform_acctest" {
resource "ionoscloud_k8s_cluster" "terraform_acctest" {
name = "terraform_acctest2"
k8s_version = "1.20.6"
k8s_version = "1.20.8"
maintenance_window {
day_of_the_week = "Monday"
time = "09:00:00Z"
Expand Down Expand Up @@ -239,7 +239,7 @@ resource "ionoscloud_datacenter" "terraform_acctest" {
resource "ionoscloud_k8s_cluster" "terraform_acctest" {
name = "terraform_acctest2"
k8s_version = "1.20.6"
k8s_version = "1.20.8"
maintenance_window {
day_of_the_week = "Monday"
time = "09:00:00Z"
Expand Down Expand Up @@ -284,7 +284,7 @@ resource "ionoscloud_lan" "terraform_acctest" {
resource "ionoscloud_k8s_cluster" "terraform_acctest" {
name = "terraform_acctest_lan"
k8s_version = "1.20.6"
k8s_version = "1.20.8"
maintenance_window {
day_of_the_week = "Monday"
time = "09:00:00Z"
Expand Down Expand Up @@ -324,7 +324,7 @@ resource "ionoscloud_lan" "terraform_acctest" {
resource "ionoscloud_k8s_cluster" "terraform_acctest" {
name = "terraform_acctest_lan"
k8s_version = "1.20.6"
k8s_version = "1.20.8"
maintenance_window {
day_of_the_week = "Monday"
time = "09:00:00Z"
Expand Down

0 comments on commit 8fd48da

Please sign in to comment.