diff --git a/grid-client/integration_tests/batch_k8s_test.go b/grid-client/integration_tests/batch_k8s_test.go index 58245f07..71160c89 100644 --- a/grid-client/integration_tests/batch_k8s_test.go +++ b/grid-client/integration_tests/batch_k8s_test.go @@ -46,38 +46,38 @@ func TestBatchK8sDeployment(t *testing.T) { require.NoError(t, err) }) - masterVM1, err := generateBasicVM(generateRandString(10), nodeID1, network.Name, "") + master1VM, err := generateBasicVM(generateRandString(10), nodeID1, network.Name, "") require.NoError(t, err) master1 := workloads.K8sNode{ - VM: &masterVM1, + VM: &master1VM, DiskSizeGB: 1, } - masterVM2, err := generateBasicVM(generateRandString(10), nodeID2, network.Name, "") + master2VM, err := generateBasicVM(generateRandString(10), nodeID2, network.Name, "") require.NoError(t, err) master2 := workloads.K8sNode{ - VM: &masterVM2, + VM: &master2VM, DiskSizeGB: 1, } vm1, err := generateBasicVM(generateRandString(10), nodeID1, network.Name, "") require.NoError(t, err) - workerNodeData1 := workloads.K8sNode{ + worker1NodeData := workloads.K8sNode{ VM: &vm1, DiskSizeGB: 1, } vm2, err := generateBasicVM(generateRandString(10), nodeID2, network.Name, "") require.NoError(t, err) - workerNodeData2 := workloads.K8sNode{ + worker2NodeData := workloads.K8sNode{ VM: &vm2, DiskSizeGB: 1, } k8sCluster1 := workloads.K8sCluster{ Master: &master1, - Workers: []workloads.K8sNode{workerNodeData1}, + Workers: []workloads.K8sNode{worker1NodeData}, Token: "tokens", SSHKey: publicKey, Flist: workloads.K8sFlist, @@ -86,7 +86,7 @@ func TestBatchK8sDeployment(t *testing.T) { k8sCluster2 := workloads.K8sCluster{ Master: &master2, - Workers: []workloads.K8sNode{workerNodeData2}, + Workers: []workloads.K8sNode{worker2NodeData}, Token: "tokens", SSHKey: publicKey, Flist: workloads.K8sFlist, diff --git a/grid-client/integration_tests/k8s_test.go b/grid-client/integration_tests/k8s_test.go index 5b17ac5f..477e25a1 100644 --- a/grid-client/integration_tests/k8s_test.go +++ b/grid-client/integration_tests/k8s_test.go @@ -89,20 +89,20 @@ func TestK8sDeployment(t *testing.T) { vm1, err := generateBasicVM(fmt.Sprintf("worker1_%s", generateRandString(5)), workerNodeID, network.Name, "") require.NoError(t, err) - workerNodeData1 := workloads.K8sNode{ + worker1NodeData := workloads.K8sNode{ VM: &vm1, DiskSizeGB: 1, } vm2, err := generateBasicVM(fmt.Sprintf("worker2_%s", generateRandString(5)), workerNodeID, network.Name, "") require.NoError(t, err) - workerNodeData2 := workloads.K8sNode{ + worker2NodeData := workloads.K8sNode{ VM: &vm2, DiskSizeGB: 1, } // deploy k8s cluster - workers := []workloads.K8sNode{workerNodeData1, workerNodeData2} + workers := []workloads.K8sNode{worker1NodeData, worker2NodeData} k8sCluster := workloads.K8sCluster{ Master: &master, @@ -146,7 +146,7 @@ func TestK8sDeployment(t *testing.T) { // require.NoError(t, requireNodesAreReady(len(k8s.Workers)+1, masterIP, privateKey)) // update k8s cluster (remove worker) - k8sCluster.Workers = []workloads.K8sNode{workerNodeData1} + k8sCluster.Workers = []workloads.K8sNode{worker1NodeData} err = tfPluginClient.K8sDeployer.Deploy(context.Background(), &k8sCluster) require.NoError(t, err) @@ -174,7 +174,7 @@ func TestK8sDeployment(t *testing.T) { // require.NoError(t, requireNodesAreReady(len(k8s.Workers)+1, masterIP, privateKey)) // update k8s cluster (add worker) - k8sCluster.Workers = append(k8sCluster.Workers, workerNodeData2) + k8sCluster.Workers = append(k8sCluster.Workers, worker2NodeData) err = tfPluginClient.K8sDeployer.Deploy(context.Background(), &k8sCluster) require.NoError(t, err) diff --git a/grid-client/integration_tests/setup.go b/grid-client/integration_tests/setup.go index ef78e135..4e6a85e2 100644 --- a/grid-client/integration_tests/setup.go +++ b/grid-client/integration_tests/setup.go @@ -19,7 +19,9 @@ import ( "github.com/threefoldtech/zos/pkg/gridtypes" "golang.org/x/crypto/ssh" ) - +const ( + ubuntuFlist = "https://hub.grid.tf/tf-official-apps/threefoldtech-ubuntu-22.04.flist" +) func setup() (deployer.TFPluginClient, error) { mnemonics := os.Getenv("MNEMONICS") log.Printf("mnemonics: %s", mnemonics) diff --git a/grid-client/integration_tests/two_vms_same_network_test.go b/grid-client/integration_tests/two_vms_same_network_test.go index 3d8d0f75..eee92631 100644 --- a/grid-client/integration_tests/two_vms_same_network_test.go +++ b/grid-client/integration_tests/two_vms_same_network_test.go @@ -39,8 +39,6 @@ func TestTwoVMsSameNetworkWithPublicIPV6(t *testing.T) { network, err := generateBasicNetwork([]uint32{nodeID}) require.NoError(t, err) - ubuntuFlist := "https://hub.grid.tf/tf-official-apps/threefoldtech-ubuntu-22.04.flist" - vm1, err := generateBasicVM("vm1", nodeID, network.Name, publicKey) require.NoError(t, err) diff --git a/grid-client/integration_tests/vms_private_ips_test.go b/grid-client/integration_tests/vms_private_ips_test.go index 245273a0..2888e577 100644 --- a/grid-client/integration_tests/vms_private_ips_test.go +++ b/grid-client/integration_tests/vms_private_ips_test.go @@ -45,7 +45,7 @@ func TestDeploymentsDeploy(t *testing.T) { vm1, err := generateBasicVM(vm1Name, nodeID, network.Name, "") require.NoError(t, err) - vm1.Flist = "https://hub.grid.tf/tf-official-apps/threefoldtech-ubuntu-22.04.flist" + vm1.Flist = ubuntuFlist err = tfPluginClient.NetworkDeployer.Deploy(context.Background(), &network) if err != nil { @@ -164,7 +164,7 @@ func TestDeploymentsBatchDeploy(t *testing.T) { NetworkName: network.Name, CPU: minCPU, MemoryMB: minMemory * 1024, - Flist: "https://hub.grid.tf/tf-official-apps/threefoldtech-ubuntu-22.04.flist", + Flist: ubuntuFlist, Entrypoint: "/sbin/zinit init", }