Skip to content

Commit

Permalink
Change upgrade test to newer CAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
CecileRobertMichon committed Jan 5, 2024
1 parent bf1ae32 commit ce3aff6
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 79 deletions.
27 changes: 18 additions & 9 deletions docs/book/src/developers/releasing.md
Expand Up @@ -46,30 +46,39 @@ This must be done prior to generating release artifacts, so the release contains
- Open a PR in https://github.com/kubernetes/test-infra to change this [line](https://github.com/kubernetes/test-infra/blob/25db54eb9d52e08c16b3601726d8f154f8741025/config/prow/plugins.yaml#L344)
- Example PR: https://github.com/kubernetes/test-infra/pull/16827

### Update test capz provider metadata.yaml (skip for patch releases)
### Update test provider versions (skip for patch releases)

This can be done in parallel with release publishing and does not impact the release or its artifacts.

#### Update test capz provider metadata.yaml

Using that same next release version used to create a new milestone, update the the capz provider [metadata.yaml](https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/main/test/e2e/data/shared/v1beta1_provider/metadata.yaml) that we use to run PR and periodic cluster E2E tests against the main branch templates.

For example, if the latest stable API version of capz that we run E2E tests against is `v1beta`, and we're releasing `v1.4.0`, and our next release version is `v1.5.0`, then we want to ensure that the `metadata.yaml` defines a contract between `1.5` and `v1beta1`:
For example, if the latest stable API version of capz that we run E2E tests against is `v1beta`, and we're releasing `v1.12.0`, and our next release version is `v1.13.0`, then we want to ensure that the `metadata.yaml` defines a contract between `v1.13.0` and `v1beta1`:

```yaml
apiVersion: clusterctl.cluster.x-k8s.io/v1alpha3
releaseSeries:
- major: 0
minor: 5
contract: v1alpha4
- major: 1
minor: 5
minor: 11
contract: v1beta1
- major: 1
minor: 12
contract: v1beta1
- major: 1
minor: 13
contract: v1beta1
```

Additionally, we need to update the `type: InfrastructureProvider` spec in [azure-dev.yaml](https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/main/test/e2e/config/azure-dev.yaml) to express that our intent is to test (using the above example) `1.5`. By convention we use a sentinel patch version "99" to express "any patch version". In this example we want to look for the `type: InfrastructureProvider` with a `name` value of `v1.4.99` and update it to `v1.5.99`:
Additionally, we need to update the `type: InfrastructureProvider` spec in [azure-dev.yaml](https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/main/test/e2e/config/azure-dev.yaml) to express that our intent is to test (using the above example) `1.5`. By convention we use a sentinel patch version "99" to express "any patch version". In this example we want to look for the `type: InfrastructureProvider` with a `name` value of `v1.12.99` and update it to `v1.13.99`:

```yaml
- name: v1.5.99 # "vNext"; use manifests from local source files
- name: v1.13.99 # "vNext"; use manifests from local source files
```

This can be done in parallel with release publishing and does not impact the release or its artifacts.
#### Update clusterctl API version upgrade tests

Update the [API version upgrade tests](https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/main/test/e2e/capi_test.go#L214) to use the oldest supported release versions of CAPI and CAPZ after the release is cut as "Init" provider versions. See [this PR](https://github.com/kubernetes-sigs/cluster-api-provider-azure/pull/4433) for more details.

### Open a PR for release notes

Expand Down
11 changes: 6 additions & 5 deletions test/e2e/capi_test.go
Expand Up @@ -259,11 +259,12 @@ var _ = Describe("Running the Cluster API E2E tests", func() {
ControlPlaneWaiters: clusterctl.ControlPlaneWaiters{
WaitForControlPlaneInitialized: EnsureControlPlaneInitialized,
},
InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.0.5/clusterctl-{OS}-{ARCH}",
InitWithCoreProvider: "cluster-api:v1.0.5",
InitWithBootstrapProviders: []string{"kubeadm:v1.0.5"},
InitWithControlPlaneProviders: []string{"kubeadm:v1.0.5"},
InitWithInfrastructureProviders: []string{"azure:v1.0.2"},
InitWithKubernetesVersion: "v1.26.12",
InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.4.9/clusterctl-{OS}-{ARCH}",
InitWithCoreProvider: "cluster-api:v1.4.9",
InitWithBootstrapProviders: []string{"kubeadm:v1.4.9"},
InitWithControlPlaneProviders: []string{"kubeadm:v1.4.9"},
InitWithInfrastructureProviders: []string{"azure:v1.11.7"},
}
})
})
Expand Down
23 changes: 9 additions & 14 deletions test/e2e/config/azure-dev.yaml
Expand Up @@ -16,8 +16,8 @@ providers:
- name: cluster-api
type: CoreProvider
versions:
- name: v1.0.5 # earliest published release in the v1beta1 series; this is used for v1beta1 old --> v1beta1 latest clusterctl upgrades test only.
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.0.5/core-components.yaml"
- name: v1.5.4 # latest patch of earliest minor in supported v1beta1 releases; this is used for v1beta1 old --> v1beta1 latest clusterctl upgrades test only.
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.5.4/core-components.yaml"
type: "url"
contract: v1beta1
replacements:
Expand All @@ -39,8 +39,8 @@ providers:
- name: kubeadm
type: BootstrapProvider
versions:
- name: v1.0.5 # earliest published release in the v1beta1 series; this is used for v1beta1 old --> v1beta1 latest clusterctl upgrades test only.
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.0.5/bootstrap-components.yaml"
- name: v1.5.4 # latest patch of earliest minor in supported v1beta1 releases; this is used for v1beta1 old --> v1beta1 latest clusterctl upgrades test only.
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.5.4/bootstrap-components.yaml"
type: "url"
contract: v1beta1
replacements:
Expand All @@ -61,8 +61,8 @@ providers:
- name: kubeadm
type: ControlPlaneProvider
versions:
- name: v1.0.5 # earliest published release in the v1beta1 series; this is used for v1beta1 old --> v1beta1 latest clusterctl upgrades test only.
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.0.5/control-plane-components.yaml"
- name: v1.5.4 # latest patch of earliest minor in supported v1beta1 releases; this is used for v1beta1 old --> v1beta1 latest clusterctl upgrades test only.
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.5.4/control-plane-components.yaml"
type: "url"
contract: v1beta1
replacements:
Expand All @@ -83,13 +83,13 @@ providers:
- name: azure
type: InfrastructureProvider
versions:
- name: v1.0.2 # earliest published release in the v1beta1 series; this is used for v1beta1 old --> v1beta1 latest clusterctl upgrades test only.
value: https://github.com/kubernetes-sigs/cluster-api-provider-azure/releases/download/v1.0.2/infrastructure-components.yaml
- name: v1.11.7 # latest patch of earliest minor in supported v1beta1 releases; this is used for v1beta1 old --> v1beta1 latest clusterctl upgrades test only.
value: https://github.com/kubernetes-sigs/cluster-api-provider-azure/releases/download/v1.11.7/infrastructure-components.yaml
type: url
contract: v1beta1
files:
- sourcePath: "../data/shared/v1beta1_provider/metadata.yaml"
- sourcePath: "../data/infrastructure-azure/v1.0.2/cluster-template-prow.yaml"
- sourcePath: "../data/infrastructure-azure/v1.11.7/cluster-template-prow.yaml"
targetName: "cluster-template.yaml"
replacements:
- old: "imagePullPolicy: Always"
Expand Down Expand Up @@ -195,11 +195,6 @@ variables:
CLUSTER_IDENTITY_NAME: "cluster-identity-sp"
NODE_DRAIN_TIMEOUT: "60s"
CI_VERSION: ""
# NOTE: INIT_WITH_BINARY and INIT_WITH_KUBERNETES_VERSION are only used by the clusterctl upgrade test to initialize
# the management cluster to be upgraded.
INIT_WITH_BINARY: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.0.5/clusterctl-{OS}-{ARCH}"
INIT_WITH_PROVIDERS_CONTRACT: "v1beta1"
INIT_WITH_KUBERNETES_VERSION: "v1.23.13"
KUBETEST_CONFIGURATION: "./data/kubetest/conformance.yaml"
WINDOWS_CONTAINERD_URL: "${WINDOWS_CONTAINERD_URL:-}"
SECURITY_SCAN_FAIL_THRESHOLD: "${SECURITY_SCAN_FAIL_THRESHOLD:-100}"
Expand Down
9 changes: 0 additions & 9 deletions test/e2e/data/shared/v1alpha3/metadata.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions test/e2e/data/shared/v1alpha3_provider/metadata.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions test/e2e/data/shared/v1alpha4/metadata.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions test/e2e/data/shared/v1alpha4_provider/metadata.yaml

This file was deleted.

5 changes: 4 additions & 1 deletion test/e2e/data/shared/v1beta1_provider/metadata.yaml
Expand Up @@ -8,7 +8,10 @@
apiVersion: clusterctl.cluster.x-k8s.io/v1alpha3
releaseSeries:
- major: 1
minor: 0
minor: 11
contract: v1beta1
- major: 1
minor: 12
contract: v1beta1
- major: 1
minor: 13
Expand Down

0 comments on commit ce3aff6

Please sign in to comment.