Skip to content

Commit

Permalink
Add the new version to provisioning tests
Browse files Browse the repository at this point in the history
Signed-off-by: Parthvi <parthvi.vala@gmail.com>
  • Loading branch information
valaparthvi committed Feb 1, 2024
1 parent 94ffac6 commit cd73dbe
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 17 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/aks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ on:
description: Runner template to use
default: hosted-prov-e2e-ci-runner-spot-n2-highmem-16-gl-template-v1
type: string
provider_k8s_version:
description: Provider specific K8s version to test
downstream_k8s_version:
description: Downstream cluster K8s version to test
default: 1.26.6

jobs:
Expand All @@ -64,4 +64,4 @@ jobs:
run_support_matrix_importing_tests: ${{ inputs.run_support_matrix_importing_tests == true || (github.event_name == 'schedule' && false) }}
destroy_runner: ${{ inputs.destroy_runner ==true || (github.event_name == 'schedule' && true) }}
runner_template: ${{ inputs.runner_template || 'hosted-prov-e2e-ci-runner-spot-n2-highmem-16-gl-template-v1' }}
provider_k8s_version: ${{ inputs.provider_k8s_version || '1.26.6' }}
downstream_k8s_version: ${{ inputs.downstream_k8s_version || '1.26.6' }}
6 changes: 3 additions & 3 deletions .github/workflows/eks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ on:
description: Runner template to use
default: hosted-prov-e2e-ci-runner-spot-n2-highmem-16-gl-template-v1
type: string
provider_k8s_version:
description: Provider specific K8s version to test
downstream_k8s_version:
description: Downstream cluster K8s version to test
default: 1.26
jobs:
eks-e2e:
Expand All @@ -63,4 +63,4 @@ jobs:
run_support_matrix_importing_tests: ${{ inputs.run_support_matrix_importing_tests == true || (github.event_name == 'schedule' && false) }}
destroy_runner: ${{ inputs.destroy_runner ==true || (github.event_name == 'schedule' && true) }}
runner_template: ${{ inputs.runner_template || 'hosted-prov-e2e-ci-runner-spot-n2-highmem-16-gl-template-v1' }}
provider_k8s_version: ${{ inputs.provider_k8s_version || '1.26' }}
downstream_k8s_version: ${{ inputs.downstream_k8s_version || '1.26' }}
8 changes: 4 additions & 4 deletions .github/workflows/gke.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ on:
description: Runner template to use
default: hosted-prov-e2e-ci-runner-spot-n2-highmem-16-gl-template-v1
type: string
provider_k8s_version:
description: Provider specific K8s version to test
default: 1.27.4-gke.900
downstream_k8s_version:
description: Downstream cluster K8s version to test
default: 1.27.3-gke.100
jobs:
gke-e2e:
uses: ./.github/workflows/main.yaml
Expand All @@ -63,4 +63,4 @@ jobs:
run_support_matrix_importing_tests: ${{ inputs.run_support_matrix_importing_tests == true || (github.event_name == 'schedule' && false) }}
destroy_runner: ${{ inputs.destroy_runner ==true || (github.event_name == 'schedule' && true) }}
runner_template: ${{ inputs.runner_template || 'hosted-prov-e2e-ci-runner-spot-n2-highmem-16-gl-template-v1' }}
provider_k8s_version: ${{ inputs.provider_k8s_version || '1.27.4-gke.900' }}
downstream_k8s_version: ${{ inputs.downstream_k8s_version || '1.27.3-gke.100' }}
6 changes: 3 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ on:
description: Runner template to use
required: true
type: string
provider_k8s_version:
description: Provider specific K8s version to test
downstream_k8s_version:
description: Downstream cluster K8s version to test
type: string

env:
Expand All @@ -57,7 +57,7 @@ env:
RANCHER_PASSWORD: ${{ secrets.RANCHER_PASSWORD }}
RANCHER_LOG_COLLECTOR: ${{ github.workspace }}/.github/scripts/collect-rancher-logs.sh
GCP_RUNNER_ZONE: asia-south2-c
KUBERNETES_VERSION: ${{ inputs.provider_k8s_version }}
DOWNSTREAM_KUBERNETES_VERSION: ${{ inputs.downstream_k8s_version }}
jobs:
create-runner:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Following are the common environment variables that need to be exported for runn
2. RANCHER_PASSWORD - Admin Password for login. We currently only test with 'admin' user.
3. CATTLE_TEST_CONFIG: Config file containing cluster and cloud credential information, for e.g. cattle-config-provisioning.yaml and cattle-config-import.yaml in the root directory.
4. PROVIDER: Type of the hosted provider you want to test. Acceptable values - gke, eks, aks
5. KUBERNETES_VERSION(Optional): Provider specific Kubernetes version to test. If the env var is not provided, the value is obtained from the config, if even that is not available, it uses a provider specific default value.
5. DOWNSTREAM_KUBERNETES_VERSION (optional): Downstream cluster Kubernetes version to test. If the env var is not provided, the value is obtained from the config, if even that is not available, it uses a provider specific default value.

To run GKE:
1. GCP_CREDENTIALS - a Service Account with a JSON private key and provide the JSON here. These IAM roles are required:
Expand Down
3 changes: 1 addition & 2 deletions cattle-config-provisioning.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ gkeClusterConfig:
subnetworkName: ""
useIpAliases: true
kubernetesVersion: 1.27.3-gke.100
labels:
owner: hosted-provider-ci
labels: {}
locations: []
loggingService: logging.googleapis.com/kubernetes
maintenanceWindow: ""
Expand Down
1 change: 1 addition & 0 deletions hosted/aks/p0/p0_provisioning_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ var _ = Describe("P0Provisioning", func() {
aksConfig.DNSPrefix = &dnsPrefix
aksConfig.ResourceLocation = location
aksConfig.Tags = helper.GetTags()
aksConfig.KubernetesVersion = &k8sVersion
})
cluster, err = aks.CreateAKSHostedCluster(ctx.RancherClient, clusterName, ctx.CloudCred.ID, false, false, false, false, map[string]string{})
Expect(err).To(BeNil())
Expand Down
1 change: 1 addition & 0 deletions hosted/eks/p0/p0_provisioning_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ var _ = Describe("P0Provisioning", func() {
config.LoadAndUpdateConfig(eks.EKSClusterConfigConfigurationFileKey, eksConfig, func() {
eksConfig.Region = region
eksConfig.Tags = helper.GetTags()
eksConfig.KubernetesVersion = &k8sVersion
})
cluster, err = eks.CreateEKSHostedCluster(ctx.RancherClient, clusterName, ctx.CloudCred.ID, false, false, false, false, map[string]string{})
Expect(err).To(BeNil())
Expand Down
3 changes: 3 additions & 0 deletions hosted/gke/p0/p0_importing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ var _ = Describe("P0Importing", func() {
gkeConfig.Zone = zone
labels := helper.GetLabels()
gkeConfig.Labels = &labels
for _, np := range gkeConfig.NodePools {
np.Version = &k8sVersion
}
})
cluster, err = helper.ImportGKEHostedCluster(ctx.RancherClient, clusterName, ctx.CloudCred.ID, false, false, false, false, map[string]string{})
Expect(err).To(BeNil())
Expand Down
4 changes: 4 additions & 0 deletions hosted/gke/p0/p0_provisioning_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ var _ = Describe("P0Provisioning", func() {
gkeConfig.Zone = zone
labels := helper.GetLabels()
gkeConfig.Labels = &labels
gkeConfig.KubernetesVersion = &k8sVersion
for _, np := range gkeConfig.NodePools {
np.Version = &k8sVersion
}
})

cluster, err = gke.CreateGKEHostedCluster(ctx.RancherClient, clusterName, ctx.CloudCred.ID, false, false, false, false, map[string]string{})
Expand Down
2 changes: 1 addition & 1 deletion hosted/helpers/helper_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func GetCommonMetadataLabels() map[string]string {
}

func GetK8sVersion(provider string) string {
k8sVersion := os.Getenv("KUBERNETES_VERSION")
k8sVersion := os.Getenv("DOWNSTREAM_KUBERNETES_VERSION")
if k8sVersion != "" {
return k8sVersion
}
Expand Down

0 comments on commit cd73dbe

Please sign in to comment.