Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bugs introduced with geolocalization #38

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion hosted/aks/helper/helper_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package helper

import (
"fmt"

"github.com/Masterminds/semver/v3"
"github.com/rancher/rancher/tests/framework/clients/rancher"
management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3"
Expand Down
29 changes: 16 additions & 13 deletions hosted/aks/p0/p0_importing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,37 @@ package p0_test
import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3"
"github.com/rancher/rancher/tests/framework/extensions/clusters"
"github.com/rancher/rancher/tests/framework/extensions/clusters/aks"
nodestat "github.com/rancher/rancher/tests/framework/extensions/nodes"
"github.com/rancher/rancher/tests/framework/extensions/workloads/pods"
"github.com/rancher/rancher/tests/framework/pkg/config"
namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator"

"github.com/rancher/hosted-providers-e2e/hosted/aks/helper"
"github.com/rancher/hosted-providers-e2e/hosted/helpers"
management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3"
"github.com/rancher/rancher/tests/framework/extensions/clusters"
nodestat "github.com/rancher/rancher/tests/framework/extensions/nodes"
"github.com/rancher/rancher/tests/framework/extensions/workloads/pods"
)

var _ = Describe("P0Importing", func() {
var (
location = helpers.GetAKSLocation()
)
When("a cluster is imported", func() {
var cluster *management.Cluster
const k8sVersion = "1.26.6"

When("a cluster is imported", func() {
var (
cluster *management.Cluster
clusterName string
)
BeforeEach(func() {
var err error
err = helper.CreateAKSClusterOnAzure(location, clusterName, k8sVersion, "1")
Expect(err).To(BeNil())
location := helpers.GetAKSLocation()
clusterName = namegen.AppendRandomString("akshostcluster")
aksConfig := new(helper.ImportClusterConfig)
config.LoadAndUpdateConfig(aks.AKSClusterConfigConfigurationFileKey, aksConfig, func() {
aksConfig.ResourceGroup = clusterName
aksConfig.ResourceLocation = location
})

err := helper.CreateAKSClusterOnAzure(location, clusterName, k8sVersion, "1")
Expect(err).To(BeNil())
cluster, err = helper.ImportAKSHostedCluster(ctx.RancherClient, clusterName, ctx.CloudCred.ID, false, false, false, false, map[string]string{})
Expect(err).To(BeNil())
cluster, err = helpers.WaitUntilClusterIsReady(cluster, ctx.RancherClient)
Expand Down
11 changes: 9 additions & 2 deletions hosted/aks/p0/p0_provisioning_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package p0_test
import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator"

management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3"
nodestat "github.com/rancher/rancher/tests/framework/extensions/nodes"
Expand All @@ -19,16 +20,22 @@ import (
var _ = Describe("P0Provisioning", func() {

When("a cluster is created", func() {
var cluster *management.Cluster
var (
cluster *management.Cluster
clusterName string
)

BeforeEach(func() {
var err error
clusterName = namegen.AppendRandomString("akshostcluster")
aksConfig := new(aks.ClusterConfig)
config.LoadAndUpdateConfig(aks.AKSClusterConfigConfigurationFileKey, aksConfig, func() {
aksConfig.ResourceGroup = clusterName
dnsPrefix := clusterName + "-dns"
aksConfig.DNSPrefix = &dnsPrefix
aksConfig.ResourceLocation = helpers.GetAKSLocation()
})

var err error
cluster, err = aks.CreateAKSHostedCluster(ctx.RancherClient, clusterName, ctx.CloudCred.ID, false, false, false, false, map[string]string{})
Expect(err).To(BeNil())
cluster, err = helpers.WaitUntilClusterIsReady(cluster, ctx.RancherClient)
Expand Down
8 changes: 2 additions & 6 deletions hosted/aks/p0/p0_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/rancher/hosted-providers-e2e/hosted/helpers"
namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator"
)

var (
ctx helpers.Context
clusterName string
k8sVersion = "1.26.6"
increaseBy = 1
ctx helpers.Context
increaseBy = 1
)

func TestP0(t *testing.T) {
Expand All @@ -25,5 +22,4 @@ var _ = BeforeEach(func() {
var err error
ctx, err = helpers.CommonBeforeSuite("aks")
Expect(err).To(BeNil())
clusterName = namegen.AppendRandomString("akshostcluster")
})
11 changes: 6 additions & 5 deletions hosted/aks/support_matrix/support_matrix_importing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"fmt"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/rancher/rancher/tests/framework/extensions/clusters/aks"
"github.com/rancher/rancher/tests/framework/pkg/config"

management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3"
"github.com/rancher/rancher/tests/framework/extensions/clusters"
"github.com/rancher/rancher/tests/framework/extensions/clusters/aks"
nodestat "github.com/rancher/rancher/tests/framework/extensions/nodes"
"github.com/rancher/rancher/tests/framework/extensions/workloads/pods"
"github.com/rancher/rancher/tests/framework/pkg/config"
namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator"

"github.com/rancher/hosted-providers-e2e/hosted/aks/helper"
Expand All @@ -29,14 +29,15 @@ var _ = Describe("SupportMatrixImporting", func() {
)
BeforeEach(func() {
clusterName = namegen.AppendRandomString("akshostcluster")
var err error
err = helper.CreateAKSClusterOnAzure(location, clusterName, version, "1")
Expect(err).To(BeNil())
location := helpers.GetAKSLocation()
aksConfig := new(helper.ImportClusterConfig)
config.LoadAndUpdateConfig(aks.AKSClusterConfigConfigurationFileKey, aksConfig, func() {
aksConfig.ResourceGroup = clusterName
aksConfig.ResourceLocation = location
})

err := helper.CreateAKSClusterOnAzure(location, clusterName, version, "1")
Expect(err).To(BeNil())
cluster, err = helper.ImportAKSHostedCluster(ctx.RancherClient, clusterName, ctx.CloudCred.ID, false, false, false, false, map[string]string{})
Expect(err).To(BeNil())
cluster, err = helpers.WaitUntilClusterIsReady(cluster, ctx.RancherClient)
Expand Down
10 changes: 4 additions & 6 deletions hosted/aks/support_matrix/support_matrix_provisioning_test.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
package support_matrix_test

import (
"fmt"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"fmt"

management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3"
"github.com/rancher/rancher/tests/framework/extensions/clusters"
"github.com/rancher/rancher/tests/framework/extensions/clusters/aks"
nodestat "github.com/rancher/rancher/tests/framework/extensions/nodes"
"github.com/rancher/rancher/tests/framework/extensions/pipeline"
"github.com/rancher/rancher/tests/framework/extensions/provisioninginput"
"github.com/rancher/rancher/tests/framework/extensions/workloads/pods"
"github.com/rancher/rancher/tests/framework/pkg/config"
namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator"
Expand All @@ -32,14 +29,15 @@ var _ = Describe("SupportMatrixProvisioning", func() {
)
BeforeEach(func() {
clusterName = namegen.AppendRandomString("akshostcluster")
pipeline.UpdateHostedKubernetesVField(provisioninginput.AzureProviderName.String(), version)
var err error
aksConfig := new(aks.ClusterConfig)
config.LoadAndUpdateConfig(aks.AKSClusterConfigConfigurationFileKey, aksConfig, func() {
aksConfig.ResourceGroup = clusterName
dnsPrefix := clusterName + "-dns"
aksConfig.DNSPrefix = &dnsPrefix
aksConfig.ResourceLocation = helpers.GetAKSLocation()
aksConfig.KubernetesVersion = &version
})
var err error
cluster, err = aks.CreateAKSHostedCluster(ctx.RancherClient, clusterName, ctx.CloudCred.ID, false, false, false, false, map[string]string{})
Expect(err).To(BeNil())
cluster, err = helpers.WaitUntilClusterIsReady(cluster, ctx.RancherClient)
Expand Down
3 changes: 1 addition & 2 deletions hosted/aks/support_matrix/support_matrix_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ import (
var (
availableVersionList []string
ctx helpers.Context
location = helpers.GetAKSLocation()
)

func TestSupportMatrix(t *testing.T) {
RegisterFailHandler(Fail)
var err error
ctx, err = helpers.CommonBeforeSuite("aks")
Expect(err).To(BeNil())
availableVersionList, err = helper.ListSingleVariantAKSAvailableVersions(ctx.RancherClient, ctx.CloudCred.ID, location)
availableVersionList, err = helper.ListSingleVariantAKSAvailableVersions(ctx.RancherClient, ctx.CloudCred.ID, helpers.GetAKSLocation())
Expect(err).To(BeNil())
RunSpecs(t, "SupportMatrix Suite")
}
1 change: 0 additions & 1 deletion hosted/eks/helper/helper_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package helper

import (
"fmt"

"github.com/rancher/rancher/tests/framework/clients/rancher"
management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3"
"github.com/rancher/rancher/tests/framework/extensions/clusters/kubernetesversions"
Expand Down
22 changes: 16 additions & 6 deletions hosted/eks/p0/p0_importing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package p0_test
import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/rancher/rancher/tests/framework/pkg/config"
namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator"

management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3"
"github.com/rancher/rancher/tests/framework/extensions/clusters"
Expand All @@ -14,16 +16,24 @@ import (
)

var _ = Describe("P0Importing", func() {
var (
cluster *management.Cluster
region = helpers.GetEKSRegion()
const (
k8sVersion = "1.26"
)

When("a cluster is imported", func() {
var (
cluster *management.Cluster
clusterName, region string
)

BeforeEach(func() {
var err error
err = helper.CreateEKSClusterOnAWS(region, clusterName, k8sVersion, "1")
region = helpers.GetEKSRegion()
eksClusterConfig := new(helper.ImportClusterConfig)
config.LoadAndUpdateConfig("eksClusterConfig", eksClusterConfig, func() {
eksClusterConfig.Region = region
})

clusterName = namegen.AppendRandomString("ekshostcluster")
err := helper.CreateEKSClusterOnAWS(region, clusterName, k8sVersion, "1")
Expect(err).To(BeNil())
cluster, err = helper.ImportEKSHostedCluster(ctx.RancherClient, clusterName, ctx.CloudCred.ID, false, false, false, false, map[string]string{})
Expect(err).To(BeNil())
Expand Down
15 changes: 12 additions & 3 deletions hosted/eks/p0/p0_provisioning_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,33 @@ package p0_test
import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3"
"github.com/rancher/rancher/tests/framework/extensions/clusters"
"github.com/rancher/rancher/tests/framework/extensions/clusters/eks"
nodestat "github.com/rancher/rancher/tests/framework/extensions/nodes"
"github.com/rancher/rancher/tests/framework/extensions/workloads/pods"
"github.com/rancher/rancher/tests/framework/pkg/config"
namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator"

"github.com/rancher/hosted-providers-e2e/hosted/eks/helper"
"github.com/rancher/hosted-providers-e2e/hosted/helpers"
)

var _ = Describe("P0Provisioning", func() {
var cluster *management.Cluster

When("a cluster is created", func() {
var (
cluster *management.Cluster
clusterName string
)

BeforeEach(func() {
eksClusterConfig := new(eks.ClusterConfig)
config.LoadAndUpdateConfig("eksClusterConfig", eksClusterConfig, func() {
eksClusterConfig.Region = helpers.GetEKSRegion()
})

var err error
clusterName = namegen.AppendRandomString("ekshostcluster")
cluster, err = eks.CreateEKSHostedCluster(ctx.RancherClient, clusterName, ctx.CloudCred.ID, false, false, false, false, map[string]string{})
Expect(err).To(BeNil())
cluster, err = helpers.WaitUntilClusterIsReady(cluster, ctx.RancherClient)
Expand Down
8 changes: 2 additions & 6 deletions hosted/eks/p0/p0_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/rancher/hosted-providers-e2e/hosted/helpers"
namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator"
)

var (
ctx helpers.Context
clusterName string
k8sVersion = "1.26"
increaseBy = 1
ctx helpers.Context
increaseBy = 1
)

func TestP0(t *testing.T) {
Expand All @@ -25,5 +22,4 @@ var _ = BeforeEach(func() {
var err error
ctx, err = helpers.CommonBeforeSuite("eks")
Expect(err).To(BeNil())
clusterName = namegen.AppendRandomString("ekshostcluster")
})
20 changes: 14 additions & 6 deletions hosted/eks/support_matrix/support_matrix_importing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ package support_matrix_test
import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/rancher/rancher/tests/framework/pkg/config"
namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator"

"fmt"

"github.com/rancher/hosted-providers-e2e/hosted/eks/helper"
"github.com/rancher/hosted-providers-e2e/hosted/helpers"
management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3"
"github.com/rancher/rancher/tests/framework/extensions/clusters"
nodestat "github.com/rancher/rancher/tests/framework/extensions/nodes"
"github.com/rancher/rancher/tests/framework/extensions/workloads/pods"
namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator"

"github.com/rancher/hosted-providers-e2e/hosted/eks/helper"
"github.com/rancher/hosted-providers-e2e/hosted/helpers"
)

var _ = Describe("SupportMatrixImporting", func() {
Expand All @@ -25,11 +25,19 @@ var _ = Describe("SupportMatrixImporting", func() {
var (
clusterName string
cluster *management.Cluster
region string
)

BeforeEach(func() {
region = helpers.GetEKSRegion()
clusterName = namegen.AppendRandomString("ekshostcluster")
var err error
err = helper.CreateEKSClusterOnAWS(region, clusterName, version, "1")

eksClusterConfig := new(helper.ImportClusterConfig)
config.LoadAndUpdateConfig("eksClusterConfig", eksClusterConfig, func() {
eksClusterConfig.Region = region
})

err := helper.CreateEKSClusterOnAWS(region, clusterName, version, "1")
Expect(err).To(BeNil())
cluster, err = helper.ImportEKSHostedCluster(ctx.RancherClient, clusterName, ctx.CloudCred.ID, false, false, false, false, map[string]string{})
Expect(err).To(BeNil())
Expand Down
13 changes: 8 additions & 5 deletions hosted/eks/support_matrix/support_matrix_provisioning_test.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
package support_matrix_test

import (
"fmt"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"fmt"
"github.com/rancher/rancher/tests/framework/pkg/config"

management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3"
"github.com/rancher/rancher/tests/framework/extensions/clusters"
"github.com/rancher/rancher/tests/framework/extensions/clusters/eks"
nodestat "github.com/rancher/rancher/tests/framework/extensions/nodes"
"github.com/rancher/rancher/tests/framework/extensions/pipeline"
"github.com/rancher/rancher/tests/framework/extensions/provisioninginput"
"github.com/rancher/rancher/tests/framework/extensions/workloads/pods"
namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator"

Expand All @@ -30,8 +28,13 @@ var _ = Describe("SupportMatrixProvisioning", func() {
cluster *management.Cluster
)
BeforeEach(func() {
eksClusterConfig := new(eks.ClusterConfig)
config.LoadAndUpdateConfig("eksClusterConfig", eksClusterConfig, func() {
eksClusterConfig.Region = helpers.GetEKSRegion()
eksClusterConfig.KubernetesVersion = &version
})

clusterName = namegen.AppendRandomString("ekshostcluster")
pipeline.UpdateHostedKubernetesVField(provisioninginput.AWSProviderName.String(), version)
var err error
cluster, err = eks.CreateEKSHostedCluster(ctx.RancherClient, clusterName, ctx.CloudCred.ID, false, false, false, false, map[string]string{})
Expect(err).To(BeNil())
Expand Down
1 change: 0 additions & 1 deletion hosted/eks/support_matrix/support_matrix_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
var (
availableVersionList []string
ctx helpers.Context
region = helpers.GetEKSRegion()
)

func TestSupportMatrix(t *testing.T) {
Expand Down
Loading
Loading