Skip to content

Commit fde866d

Browse files
Merge pull request #3592 from Azure/ARO-22851-parametrize-ocp-versions
ARO-22851 parametrize ocp versions
2 parents 8e7b7fa + fb0fcf8 commit fde866d

18 files changed

+87
-39
lines changed

test/e2e-setup/bicep/cluster-nodepool-osdisk.bicep

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ param identities object
1212
@description('When true, use the pre-created MSI pool instead of creating identities in the cluster resource group')
1313
param usePooledIdentities bool = false
1414

15+
@description('ControlPlane OpenShift Version ID')
16+
param openshiftControlPlaneVersionId string = '4.20'
17+
18+
@description('NodePool OpenShift Version ID')
19+
param openshiftNodePoolVersionId string = '4.20.5'
20+
1521
@description('Node pool osDisk Size in GiB')
1622
param nodePoolOsDiskSizeGiB int = 128
1723

@@ -46,6 +52,7 @@ module managedIdentities 'modules/managed-identities.bicep' = {
4652
module AroHcpCluster 'modules/cluster.bicep' = {
4753
name: 'cluster'
4854
params: {
55+
openshiftVersionId: openshiftControlPlaneVersionId
4956
clusterName: clusterName
5057
vnetName: customerInfra.outputs.vnetName
5158
subnetName: customerInfra.outputs.vnetSubnetName
@@ -60,6 +67,7 @@ module AroHcpCluster 'modules/cluster.bicep' = {
6067
module AroHcpNodePool 'modules/nodepool.bicep' = {
6168
name: 'nodepool'
6269
params: {
70+
openshiftVersionId: openshiftNodePoolVersionId
6371
clusterName: AroHcpCluster.outputs.name
6472
nodePoolName: nodePoolName
6573
osDiskSizeGiB: nodePoolOsDiskSizeGiB

test/e2e-setup/bicep/cluster-only.bicep

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ param identities object
1212
@description('When true, use the pre-created MSI pool instead of creating identities in the cluster resource group')
1313
param usePooledIdentities bool = false
1414

15+
@description('ControlPlane OpenShift Version ID')
16+
param openshiftControlPlaneVersionId string = '4.20'
17+
1518
module customerInfra 'modules/customer-infra.bicep' = {
1619
name: 'customerInfra'
1720
params: {
@@ -37,6 +40,7 @@ module managedIdentities 'modules/managed-identities.bicep' = {
3740
module AroHcpCluster 'modules/cluster.bicep' = {
3841
name: 'cluster'
3942
params: {
43+
openshiftVersionId: openshiftControlPlaneVersionId
4044
clusterName: clusterName
4145
vnetName: customerInfra.outputs.vnetName
4246
subnetName: customerInfra.outputs.vnetSubnetName

test/e2e-setup/bicep/demo.bicep

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ param identities object
1212
@description('When true, use the pre-created MSI pool instead of creating identities in the cluster resource group')
1313
param usePooledIdentities bool = false
1414

15+
@description('ControlPlane OpenShift Version ID')
16+
param openshiftControlPlaneVersionId string = '4.20'
17+
18+
@description('NodePool OpenShift Version ID')
19+
param openshiftNodePoolVersionId string = '4.20.5'
20+
1521
module customerInfra 'modules/customer-infra.bicep' = {
1622
name: 'customerInfra'
1723
params: {
@@ -37,6 +43,7 @@ module managedIdentities 'modules/managed-identities.bicep' = {
3743
module AroHcpCluster 'modules/cluster.bicep' = {
3844
name: 'cluster'
3945
params: {
46+
openshiftVersionId: openshiftControlPlaneVersionId
4047
clusterName: clusterName
4148
vnetName: customerInfra.outputs.vnetName
4249
subnetName: customerInfra.outputs.vnetSubnetName
@@ -51,6 +58,7 @@ module AroHcpCluster 'modules/cluster.bicep' = {
5158
module AroHcpNodePool 'modules/nodepool.bicep' = {
5259
name: 'nodepool-1'
5360
params: {
61+
openshiftVersionId: openshiftNodePoolVersionId
5462
clusterName: AroHcpCluster.outputs.name
5563
nodePoolName: 'nodepool-1'
5664
}

test/e2e-setup/bicep/modules/cluster.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ param vnetName string
1414
param subnetName string
1515

1616
@description('OpenShift Version ID to use')
17-
param openshiftVersionId string = '4.19'
17+
param openshiftVersionId string
1818

1919
@description('Network configuration of the hosted cluster')
2020
param networkConfig object = {

test/e2e-setup/bicep/modules/nodepool.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ param nodePoolName string
88
param replicas int = 2
99

1010
@description('OpenShift Version ID to use')
11-
param openshiftVersionId string = '4.19.7'
11+
param openshiftVersionId string
1212
@description('Size of the osDisk for the node pool in GiB')
1313
param osDiskSizeGiB int = 64
1414

test/e2e-setup/bicep/no-cni.bicep

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ param clusterName string
99
@description('Managed identities to use')
1010
param identities object
1111

12+
@description('ControlPlane OpenShift Version ID')
13+
param openshiftControlPlaneVersionId string = '4.20'
14+
1215
module customerInfra 'modules/customer-infra.bicep' = {
1316
name: 'customerInfra'
1417
params: {
@@ -33,6 +36,7 @@ module managedIdentities 'modules/managed-identities.bicep' = {
3336
module AroHcpCluster 'modules/cluster.bicep' = {
3437
name: 'cluster'
3538
params: {
39+
openshiftVersionId: openshiftControlPlaneVersionId
3640
clusterName: clusterName
3741
vnetName: customerInfra.outputs.vnetName
3842
subnetName: customerInfra.outputs.vnetSubnetName

test/e2e/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ export CUSTOMER_SUBSCRIPTION=<subscriptionName>
6666
export LOCATION=uksouth
6767
```
6868

69+
You can also redefine default OpenShift versions the E2E test cases will use
70+
when deploying ARO HCP hosted cluster, eg.:
71+
72+
```bash
73+
$ export ARO_HCP_OPENSHIFT_CONTROLPLANE_VERSION=4.20
74+
$ export ARO_HCP_OPENSHIFT_NODEPOOL_VERSION=4.20.5
75+
```
76+
6977
So finally, you can run a particular test case:
7078

7179
```bash

test/e2e/arm64_nodepool.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ var _ = Describe("Customer", func() {
4444
customerVnetSubnetName = "arm64-vm-subnet1"
4545
customerClusterName = "arm64-vm-hcp-cluster"
4646
customerNodePoolName = "arm64-vm-np-1"
47-
openshiftControlPlaneVersionId = "4.19"
48-
openshiftNodeVersionId = "4.19.7"
4947
)
5048
// This pattern matches a subset of the smallest (2GiB) ARM64-capable VM sizes listed in https://issues.redhat.com/browse/ARO-22443
5149
vmSizePattern := regexp.MustCompile(`^Standard_D(?:2|4)pl(?:d)?s_v6$`)
@@ -66,7 +64,6 @@ var _ = Describe("Customer", func() {
6664
clusterParams.ClusterName = customerClusterName
6765
managedResourceGroupName := framework.SuffixName(*resourceGroup.Name, "-managed", 64)
6866
clusterParams.ManagedResourceGroupName = managedResourceGroupName
69-
clusterParams.OpenshiftVersionId = openshiftControlPlaneVersionId
7067

7168
By("creating customer resources")
7269
clusterParams, err = tc.CreateClusterCustomerResources(ctx,
@@ -100,7 +97,6 @@ var _ = Describe("Customer", func() {
10097
nodePoolParams := framework.NewDefaultNodePoolParams()
10198
nodePoolParams.ClusterName = customerClusterName
10299
nodePoolParams.NodePoolName = customerNodePoolName
103-
nodePoolParams.OpenshiftVersionId = openshiftNodeVersionId
104100
nodePoolParams.Replicas = int32(2)
105101
nodePoolParams.VMSize = nodePoolVMSize
106102

test/e2e/cluster_authorized_cidrs_connectivity.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ var _ = Describe("Authorized CIDRs", func() {
4747
customerNetworkSecurityGroupName = "customer-nsg-name"
4848
customerVnetName = "customer-vnet-name"
4949
customerVnetSubnetName = "customer-vnet-subnet1"
50-
openshiftControlPlaneVersionId = "4.19"
5150
)
5251

5352
tc := framework.NewTestContext()
@@ -61,7 +60,6 @@ var _ = Describe("Authorized CIDRs", func() {
6160
clusterParams.ClusterName = clusterName
6261
managedResourceGroupName := framework.SuffixName(*resourceGroup.Name, "-managed", 64)
6362
clusterParams.ManagedResourceGroupName = managedResourceGroupName
64-
clusterParams.OpenshiftVersionId = openshiftControlPlaneVersionId
6563

6664
By("creating customer resources")
6765
clusterParams, err = tc.CreateClusterCustomerResources(ctx,

test/e2e/cluster_create_nodepool_osdisk.go

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ var _ = Describe("Customer", func() {
4444
customerNodeReplicas int32 = 2
4545
)
4646
tc := framework.NewTestContext()
47+
openshiftControlPlaneVersionId := framework.DefaultOpenshiftControlPlaneVersionId()
48+
openshiftNodeVersionId := framework.DefaultOpenshiftNodePoolVersionId()
4749

4850
if tc.UsePooledIdentities() {
4951
err := tc.AssignIdentityContainers(ctx, 1, 60*time.Second)
@@ -65,13 +67,15 @@ var _ = Describe("Customer", func() {
6567
framework.WithScope(framework.BicepDeploymentScopeResourceGroup),
6668
framework.WithClusterResourceGroup(*resourceGroup.Name),
6769
framework.WithParameters(map[string]interface{}{
68-
"persistTagValue": false,
69-
"clusterName": customerClusterName,
70-
"nodePoolName": customerNodePoolName,
71-
"nodePoolOsDiskSizeGiB": customerNodeOsDiskSizeGiB,
72-
"nodeReplicas": customerNodeReplicas,
73-
"identities": identities,
74-
"usePooledIdentities": usePooled,
70+
"openshiftControlPlaneVersionId": openshiftControlPlaneVersionId,
71+
"openshiftNodePoolVersionId": openshiftNodeVersionId,
72+
"persistTagValue": false,
73+
"clusterName": customerClusterName,
74+
"nodePoolName": customerNodePoolName,
75+
"nodePoolOsDiskSizeGiB": customerNodeOsDiskSizeGiB,
76+
"nodeReplicas": customerNodeReplicas,
77+
"identities": identities,
78+
"usePooledIdentities": usePooled,
7579
}),
7680
framework.WithTimeout(45*time.Minute),
7781
)

0 commit comments

Comments
 (0)