Skip to content

Commit

Permalink
Merge pull request #4449 from CecileRobertMichon/cherry-pick-4433-1.11
Browse files Browse the repository at this point in the history
[release-1.11] Change upgrade test to newer CAPI
  • Loading branch information
k8s-ci-robot authored Jan 11, 2024
2 parents 9dda276 + 8881420 commit e9a98b4
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 80 deletions.
27 changes: 19 additions & 8 deletions docs/book/src/developers/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,29 +44,40 @@ Sometimes pull requests touch a large number of files and are more likely to cre
- 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`:

```
- name: v1.5.99 # "vNext"; use manifests from local source files
- name: v1.13.99 # "vNext"; use manifests from local source files
```
#### Update clusterctl API version upgrade tests
Update the [API version upgrade tests](https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/v1.12.1/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.
### Create a tag
Before you create a GPG-signed tag you may need to prepare your local environment's TTY to properly hoist your signed key into the flow of the `git tag` command:
Expand Down
11 changes: 6 additions & 5 deletions test/e2e/capi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,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.5.4/clusterctl-{OS}-{ARCH}",
InitWithCoreProvider: "cluster-api:v1.5.4",
InitWithBootstrapProviders: []string{"kubeadm:v1.5.4"},
InitWithControlPlaneProviders: []string{"kubeadm:v1.5.4"},
InitWithInfrastructureProviders: []string{"azure:v1.9.8"},
}
})
})
Expand Down
25 changes: 10 additions & 15 deletions test/e2e/config/azure-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,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 @@ -37,8 +37,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 @@ -59,8 +59,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 @@ -81,18 +81,18 @@ 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.9.8 # 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.9.8/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.9.8/cluster-template-prow.yaml"
targetName: "cluster-template.yaml"
replacements:
- old: "imagePullPolicy: Always"
new: "imagePullPolicy: IfNotPresent"
- name: v1.12.99 # "vNext"; use manifests from local source files
- name: v1.11.99 # "vNext"; use manifests from local source files
value: "${PWD}/config/default"
contract: v1beta1
files:
Expand Down Expand Up @@ -173,11 +173,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.

7 changes: 5 additions & 2 deletions test/e2e/data/shared/v1beta1_provider/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
apiVersion: clusterctl.cluster.x-k8s.io/v1alpha3
releaseSeries:
- major: 1
minor: 0
minor: 9
contract: v1beta1
- major: 1
minor: 12
minor: 10
contract: v1beta1
- major: 1
minor: 11
contract: v1beta1

0 comments on commit e9a98b4

Please sign in to comment.