Skip to content

Commit 5c4ce8b

Browse files
Prepare main branch for v1.6 development
Signed-off-by: Furkat Gofurov <[email protected]>
1 parent 98fa0ca commit 5c4ce8b

File tree

17 files changed

+293
-186
lines changed

17 files changed

+293
-186
lines changed

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ generate-doctoc:
508508
TRACE=$(TRACE) ./hack/generate-doctoc.sh
509509

510510
.PHONY: generate-e2e-templates
511-
generate-e2e-templates: $(KUSTOMIZE) $(addprefix generate-e2e-templates-, v1.0 v1.3 v1.4 main) ## Generate cluster templates for all versions
511+
generate-e2e-templates: $(KUSTOMIZE) $(addprefix generate-e2e-templates-, v1.0 v1.4 v1.5 main) ## Generate cluster templates for all versions
512512

513513
DOCKER_TEMPLATES := test/e2e/data/infrastructure-docker
514514
INMEMORY_TEMPLATES := test/e2e/data/infrastructure-inmemory
@@ -517,16 +517,16 @@ INMEMORY_TEMPLATES := test/e2e/data/infrastructure-inmemory
517517
generate-e2e-templates-v1.0: $(KUSTOMIZE)
518518
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1.0/cluster-template --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1.0/cluster-template.yaml
519519

520-
.PHONY: generate-e2e-templates-v1.3
521-
generate-e2e-templates-v1.3: $(KUSTOMIZE)
522-
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1.3/cluster-template --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1.3/cluster-template.yaml
523-
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1.3/cluster-template-topology --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1.3/cluster-template-topology.yaml
524-
525520
.PHONY: generate-e2e-templates-v1.4
526521
generate-e2e-templates-v1.4: $(KUSTOMIZE)
527522
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1.4/cluster-template --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1.4/cluster-template.yaml
528523
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1.4/cluster-template-topology --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1.4/cluster-template-topology.yaml
529524

525+
.PHONY: generate-e2e-templates-v1.5
526+
generate-e2e-templates-v1.5: $(KUSTOMIZE)
527+
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1.5/cluster-template --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1.5/cluster-template.yaml
528+
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1.5/cluster-template-topology --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1.5/cluster-template-topology.yaml
529+
530530
.PHONY: generate-e2e-templates-main
531531
generate-e2e-templates-main: $(KUSTOMIZE)
532532
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template.yaml

cmd/clusterctl/hack/create-local-repository.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,36 +52,36 @@
5252
providers = {
5353
'cluster-api': {
5454
'componentsFile': 'core-components.yaml',
55-
'nextVersion': 'v1.5.99',
55+
'nextVersion': 'v1.6.99',
5656
'type': 'CoreProvider',
5757
},
5858
'bootstrap-kubeadm': {
5959
'componentsFile': 'bootstrap-components.yaml',
60-
'nextVersion': 'v1.5.99',
60+
'nextVersion': 'v1.6.99',
6161
'type': 'BootstrapProvider',
6262
'configFolder': 'bootstrap/kubeadm/config/default',
6363
},
6464
'control-plane-kubeadm': {
6565
'componentsFile': 'control-plane-components.yaml',
66-
'nextVersion': 'v1.5.99',
66+
'nextVersion': 'v1.6.99',
6767
'type': 'ControlPlaneProvider',
6868
'configFolder': 'controlplane/kubeadm/config/default',
6969
},
7070
'infrastructure-docker': {
7171
'componentsFile': 'infrastructure-components.yaml',
72-
'nextVersion': 'v1.5.99',
72+
'nextVersion': 'v1.6.99',
7373
'type': 'InfrastructureProvider',
7474
'configFolder': 'test/infrastructure/docker/config/default',
7575
},
7676
'infrastructure-in-memory': {
7777
'componentsFile': 'infrastructure-components.yaml',
78-
'nextVersion': 'v1.5.99',
78+
'nextVersion': 'v1.6.99',
7979
'type': 'InfrastructureProvider',
8080
'configFolder': 'test/infrastructure/inmemory/config/default',
8181
},
8282
'runtime-extension-test': {
8383
'componentsFile': 'runtime-extension-components.yaml',
84-
'nextVersion': 'v1.5.99',
84+
'nextVersion': 'v1.6.99',
8585
'type': 'RuntimeExtensionProvider',
8686
'configFolder': 'test/extension/config/default',
8787
},

docs/release/release-tasks.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ This comes down to changing occurrences of the old version to the new version, e
108108
1. Create a new `v1.4` `metadata.yaml` (`test/e2e/data/shared/v1.4/metadata.yaml`) by copying
109109
`test/e2e/data/shared/main/metadata.yaml`
110110
2. Add the new release to the main `metadata.yaml` (`test/e2e/data/shared/main/metadata.yaml`).
111-
3. Remove old `metadata.yaml`'s that are not used anymore in clusterctl upgrade tests.
111+
3. Add the new release to the root level `metadata.yaml`
112+
4. Remove old `metadata.yaml`'s that are not used anymore in clusterctl upgrade tests.
112113
4. Adjust cluster templates in `test/e2e/data/infrastructure-docker`:
113114
1. Create a new `v1.4` folder. It should be created based on the `main` folder and only contain the templates
114115
we use in the clusterctl upgrade tests (as of today `cluster-template` and `cluster-template-topology`).
@@ -119,8 +120,8 @@ This comes down to changing occurrences of the old version to the new version, e
119120
3. Make sure all tests are green (also run `pull-cluster-api-e2e-full-main` and `pull-cluster-api-e2e-workload-upgrade-1-23-latest-main`).
120121

121122
Prior art:
122-
- 1.3 - https://github.com/kubernetes-sigs/cluster-api/pull/6834/files
123123
- 1.4 - https://github.com/kubernetes-sigs/cluster-api/pull/7692/files
124+
- 1.5 - https://github.com/kubernetes-sigs/cluster-api/pull/8430/files
124125

125126
#### Create a new GitHub milestone for the next release
126127

hack/tools/internal/tilt-prepare/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const (
7070

7171
var (
7272
// Defines the default version to be used for the provider CR if no version is specified in the tilt-provider.yaml|json file.
73-
defaultProviderVersion = "v1.5.99"
73+
defaultProviderVersion = "v1.6.99"
7474

7575
// This data struct mirrors a subset of info from the providers struct in the tilt file
7676
// which is containing "hard-coded" tilt-provider.yaml files for the providers managed in the Cluster API repository.

metadata.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
apiVersion: clusterctl.cluster.x-k8s.io/v1alpha3
77
kind: Metadata
88
releaseSeries:
9+
- major: 1
10+
minor: 6
11+
contract: v1beta1
912
- major: 1
1013
minor: 5
1114
contract: v1beta1

test/e2e/clusterctl_upgrade.go

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ import (
2929
. "github.com/onsi/ginkgo/v2"
3030
. "github.com/onsi/gomega"
3131
corev1 "k8s.io/api/core/v1"
32+
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
3233
apierrors "k8s.io/apimachinery/pkg/api/errors"
3334
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3435
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
36+
"k8s.io/apimachinery/pkg/runtime/schema"
3537
"k8s.io/apimachinery/pkg/util/sets"
3638
"k8s.io/client-go/discovery"
3739
"k8s.io/klog/v2"
@@ -334,6 +336,11 @@ func ClusterctlUpgradeSpec(ctx context.Context, inputGetter func() ClusterctlUpg
334336

335337
By("THE MANAGEMENT CLUSTER WITH THE OLDER VERSION OF PROVIDERS IS UP&RUNNING!")
336338

339+
machineCRD := &apiextensionsv1.CustomResourceDefinition{}
340+
if err := managementClusterProxy.GetClient().Get(ctx, client.ObjectKey{Name: "machines.cluster.x-k8s.io"}, machineCRD); err != nil {
341+
Expect(err).ToNot(HaveOccurred(), "failed to retrieve a machine CRD")
342+
}
343+
337344
Byf("Creating a namespace for hosting the %s test workload cluster", specName)
338345
testNamespace, testCancelWatches = framework.CreateNamespaceAndWatchEvents(ctx, framework.CreateNamespaceAndWatchEventsInput{
339346
Creator: managementClusterProxy.GetClient(),
@@ -387,13 +394,34 @@ func ClusterctlUpgradeSpec(ctx context.Context, inputGetter func() ClusterctlUpg
387394
input.PreWaitForCluster(managementClusterProxy, testNamespace.Name, workLoadClusterName)
388395
}
389396

397+
// Build GroupVersionKind for Machine resources
398+
machineListGVK := schema.GroupVersionKind{
399+
Group: machineCRD.Spec.Group,
400+
Kind: machineCRD.Spec.Names.ListKind,
401+
}
402+
403+
// Pick the storage version
404+
for _, version := range machineCRD.Spec.Versions {
405+
if version.Storage {
406+
machineListGVK.Version = version.Name
407+
break
408+
}
409+
}
410+
390411
By("Waiting for the machines to exist")
391412
Eventually(func() (int64, error) {
392413
var n int64
393-
machineList := &clusterv1alpha3.MachineList{}
394-
if err := managementClusterProxy.GetClient().List(ctx, machineList, client.InNamespace(testNamespace.Name), client.MatchingLabels{clusterv1.ClusterNameLabel: workLoadClusterName}); err == nil {
395-
for _, machine := range machineList.Items {
396-
if machine.Status.NodeRef != nil {
414+
machineList := &unstructured.UnstructuredList{}
415+
machineList.SetGroupVersionKind(machineListGVK)
416+
if err := managementClusterProxy.GetClient().List(
417+
ctx,
418+
machineList,
419+
client.InNamespace(testNamespace.Name),
420+
client.MatchingLabels{clusterv1.ClusterNameLabel: workLoadClusterName},
421+
); err == nil {
422+
for _, m := range machineList.Items {
423+
_, found, err := unstructured.NestedMap(m.Object, "status", "nodeRef")
424+
if err == nil && found {
397425
n++
398426
}
399427
}
@@ -411,7 +439,7 @@ func ClusterctlUpgradeSpec(ctx context.Context, inputGetter func() ClusterctlUpg
411439
// Get the workloadCluster before the management cluster is upgraded to make sure that the upgrade did not trigger
412440
// any unexpected rollouts.
413441
preUpgradeMachineList := &unstructured.UnstructuredList{}
414-
preUpgradeMachineList.SetGroupVersionKind(clusterv1alpha3.GroupVersion.WithKind("MachineList"))
442+
preUpgradeMachineList.SetGroupVersionKind(machineListGVK)
415443
err = managementClusterProxy.GetClient().List(
416444
ctx,
417445
preUpgradeMachineList,

test/e2e/clusterctl_upgrade_test.go

Lines changed: 28 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ var _ = Describe("When testing clusterctl upgrades (v1.0=>current)", func() {
6666
})
6767
})
6868

69-
var _ = Describe("When testing clusterctl upgrades (v1.3=>current)", func() {
69+
var _ = Describe("When testing clusterctl upgrades (v1.4=>current)", func() {
7070
ClusterctlUpgradeSpec(ctx, func() ClusterctlUpgradeSpecInput {
7171
return ClusterctlUpgradeSpecInput{
7272
E2EConfig: e2eConfig,
@@ -75,21 +75,17 @@ var _ = Describe("When testing clusterctl upgrades (v1.3=>current)", func() {
7575
ArtifactFolder: artifactFolder,
7676
SkipCleanup: skipCleanup,
7777
InfrastructureProvider: pointer.String("docker"),
78-
InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.3.6/clusterctl-{OS}-{ARCH}",
78+
InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.4.5/clusterctl-{OS}-{ARCH}",
7979
// We have to pin the providers because with `InitWithProvidersContract` the test would
80-
// use the latest version for the contract (which is v1.4.X for v1beta1).
81-
InitWithCoreProvider: "cluster-api:v1.3.6",
82-
InitWithBootstrapProviders: []string{"kubeadm:v1.3.6"},
83-
InitWithControlPlaneProviders: []string{"kubeadm:v1.3.6"},
84-
InitWithInfrastructureProviders: []string{"docker:v1.3.6"},
85-
// We have to set this to an empty array as clusterctl v1.3 doesn't support
86-
// runtime extension providers. If we don't do this the test will automatically
87-
// try to deploy the latest version of our test-extension from docker.yaml.
88-
InitWithRuntimeExtensionProviders: []string{},
89-
InitWithProvidersContract: "v1beta1",
90-
// NOTE: If this version is changed here the image and SHA must also be updated in all DockerMachineTemplates in `test/data/infrastructure-docker/v1.3/bases.
91-
InitWithKubernetesVersion: "v1.26.4",
92-
WorkloadKubernetesVersion: "v1.26.4",
80+
// use the latest version for the contract (which is v1.5.X for v1beta1).
81+
InitWithCoreProvider: "cluster-api:v1.4.5",
82+
InitWithBootstrapProviders: []string{"kubeadm:v1.4.5"},
83+
InitWithControlPlaneProviders: []string{"kubeadm:v1.4.5"},
84+
InitWithInfrastructureProviders: []string{"docker:v1.4.5"},
85+
InitWithProvidersContract: "v1beta1",
86+
// NOTE: If this version is changed here the image and SHA must also be updated in all DockerMachineTemplates in `test/e2e/data/infrastructure-docker/v1.4/bases.
87+
InitWithKubernetesVersion: "v1.27.3",
88+
WorkloadKubernetesVersion: "v1.27.3",
9389
MgmtFlavor: "topology",
9490
WorkloadFlavor: "",
9591
// This check ensures that ownerReference apiVersions are updated for all types after the upgrade.
@@ -107,7 +103,7 @@ var _ = Describe("When testing clusterctl upgrades (v1.3=>current)", func() {
107103
})
108104
})
109105

110-
var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.3=>current) [ClusterClass]", func() {
106+
var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.4=>current) [ClusterClass]", func() {
111107
ClusterctlUpgradeSpec(ctx, func() ClusterctlUpgradeSpecInput {
112108
return ClusterctlUpgradeSpecInput{
113109
E2EConfig: e2eConfig,
@@ -116,21 +112,17 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.3=>cur
116112
ArtifactFolder: artifactFolder,
117113
SkipCleanup: skipCleanup,
118114
InfrastructureProvider: pointer.String("docker"),
119-
InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.3.6/clusterctl-{OS}-{ARCH}",
115+
InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.4.5/clusterctl-{OS}-{ARCH}",
120116
// We have to pin the providers because with `InitWithProvidersContract` the test would
121-
// use the latest version for the contract (which is v1.4.X for v1beta1).
122-
InitWithCoreProvider: "cluster-api:v1.3.6",
123-
InitWithBootstrapProviders: []string{"kubeadm:v1.3.6"},
124-
InitWithControlPlaneProviders: []string{"kubeadm:v1.3.6"},
125-
InitWithInfrastructureProviders: []string{"docker:v1.3.6"},
126-
// We have to set this to an empty array as clusterctl v1.3 doesn't support
127-
// runtime extension providers. If we don't do this the test will automatically
128-
// try to deploy the latest version of our test-extension from docker.yaml.
129-
InitWithRuntimeExtensionProviders: []string{},
130-
InitWithProvidersContract: "v1beta1",
131-
// NOTE: If this version is changed here the image and SHA must also be updated in all DockerMachineTemplates in `test/data/infrastructure-docker/v1.3/bases.
132-
InitWithKubernetesVersion: "v1.26.4",
133-
WorkloadKubernetesVersion: "v1.26.4",
117+
// use the latest version for the contract (which is v1.5.X for v1beta1).
118+
InitWithCoreProvider: "cluster-api:v1.4.5",
119+
InitWithBootstrapProviders: []string{"kubeadm:v1.4.5"},
120+
InitWithControlPlaneProviders: []string{"kubeadm:v1.4.5"},
121+
InitWithInfrastructureProviders: []string{"docker:v1.4.5"},
122+
InitWithProvidersContract: "v1beta1",
123+
// NOTE: If this version is changed here the image and SHA must also be updated in all DockerMachineTemplates in `test/e2e/data/infrastructure-docker/v1.4/bases.
124+
InitWithKubernetesVersion: "v1.27.3",
125+
WorkloadKubernetesVersion: "v1.27.3",
134126
MgmtFlavor: "topology",
135127
WorkloadFlavor: "topology",
136128
// This check ensures that ownerReference apiVersions are updated for all types after the upgrade.
@@ -148,7 +140,7 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.3=>cur
148140
})
149141
})
150142

151-
var _ = Describe("When testing clusterctl upgrades (v1.4=>current)", func() {
143+
var _ = Describe("When testing clusterctl upgrades (v1.5=>current)", func() {
152144
ClusterctlUpgradeSpec(ctx, func() ClusterctlUpgradeSpecInput {
153145
return ClusterctlUpgradeSpecInput{
154146
E2EConfig: e2eConfig,
@@ -157,9 +149,9 @@ var _ = Describe("When testing clusterctl upgrades (v1.4=>current)", func() {
157149
ArtifactFolder: artifactFolder,
158150
SkipCleanup: skipCleanup,
159151
InfrastructureProvider: pointer.String("docker"),
160-
InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.4.0/clusterctl-{OS}-{ARCH}",
152+
InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.5.0/clusterctl-{OS}-{ARCH}",
161153
InitWithProvidersContract: "v1beta1",
162-
// NOTE: If this version is changed here the image and SHA must also be updated in all DockerMachineTemplates in `test/data/infrastructure-docker/v1.4/bases.
154+
// NOTE: If this version is changed here the image and SHA must also be updated in all DockerMachineTemplates in `test/e2e/data/infrastructure-docker/v1.5/bases.
163155
InitWithKubernetesVersion: "v1.27.3",
164156
WorkloadKubernetesVersion: "v1.27.3",
165157
MgmtFlavor: "topology",
@@ -179,7 +171,7 @@ var _ = Describe("When testing clusterctl upgrades (v1.4=>current)", func() {
179171
})
180172
})
181173

182-
var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.4=>current) [ClusterClass]", func() {
174+
var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.5=>current) [ClusterClass]", func() {
183175
ClusterctlUpgradeSpec(ctx, func() ClusterctlUpgradeSpecInput {
184176
return ClusterctlUpgradeSpecInput{
185177
E2EConfig: e2eConfig,
@@ -188,9 +180,9 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.4=>cur
188180
ArtifactFolder: artifactFolder,
189181
SkipCleanup: skipCleanup,
190182
InfrastructureProvider: pointer.String("docker"),
191-
InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.4.0/clusterctl-{OS}-{ARCH}",
183+
InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.5.0/clusterctl-{OS}-{ARCH}",
192184
InitWithProvidersContract: "v1beta1",
193-
// NOTE: If this version is changed here the image and SHA must also be updated in all DockerMachineTemplates in `test/data/infrastructure-docker/v1.4/bases.
185+
// NOTE: If this version is changed here the image and SHA must also be updated in all DockerMachineTemplates in `test/e2e/data/infrastructure-docker/v1.5/bases.
194186
InitWithKubernetesVersion: "v1.27.3",
195187
WorkloadKubernetesVersion: "v1.27.3",
196188
MgmtFlavor: "topology",

0 commit comments

Comments
 (0)