diff --git a/.github/ISSUE_TEMPLATE/kubernetes_bump.md b/.github/ISSUE_TEMPLATE/kubernetes_bump.md index 2bcc1093b038..b5e1c53c687a 100644 --- a/.github/ISSUE_TEMPLATE/kubernetes_bump.md +++ b/.github/ISSUE_TEMPLATE/kubernetes_bump.md @@ -21,10 +21,10 @@ changes should be cherry-picked to all release series that will support the new * [ ] Continuously modify CAPD to use early versions of the upcoming Kubernetes release (betas and rcs): * Bump the Kubernetes version in `test/*` except for `test/infrastructure/kind/*`. - * Prior art: #10384 + * Prior art: https://github.com/kubernetes-sigs/cluster-api/pull/10922 * [ ] Modify CAPD to use the new Kubernetes release after it is GA: * Bump the Kubernetes version in `test/*` except for `test/infrastructure/kind/*`. - * Prior art: #10454 + * Prior art: https://github.com/kubernetes-sigs/cluster-api/pull/11030 * [ ] Ensure the jobs are adjusted to provide test coverage according to our [support policy](https://cluster-api.sigs.k8s.io/reference/versions.html#supported-kubernetes-versions): * At the `.versions` section in the `cluster-api-prowjob-gen.yaml` file in [test-infra](https://github.com/kubernetes/test-infra/blob/master/config/jobs/kubernetes-sigs/cluster-api/): @@ -45,11 +45,11 @@ changes should be cherry-picked to all release series that will support the new TEST_INFRA_DIR=../../k8s.io/test-infra make generate-test-infra-prowjobs ``` - * Prior art: #32456 + * Prior art: https://github.com/kubernetes/test-infra/pull/33294 * [ ] Update book: * Update supported versions in `versions.md` - * Prior art: #10454 + * Prior art: https://github.com/kubernetes-sigs/cluster-api/pull/11030 * [ ] Issues specific to the Kubernetes minor release: * Sometimes there are adjustments that we have to make in Cluster API to be able to support @@ -72,7 +72,7 @@ Prerequisites: * Set new default image for the [test framework](https://github.com/kubernetes-sigs/cluster-api/blob/0f47a19e038ee6b0d3b1e7675a62cdaf84face8c/test/framework/bootstrap/kind_provider.go#L40) * If code changes are required for CAPD to incorporate the new Kind version, update [kind latestMode](https://github.com/kubernetes-sigs/cluster-api/blob/0f47a19e038ee6b0d3b1e7675a62cdaf84face8c/test/infrastructure/kind/mapper.go#L66) * Verify the quickstart manually - * Prior art: #10610 + * Prior art: https://github.com/kubernetes-sigs/cluster-api/pull/10610 * [ ] Cherry-pick above PR to the latest release branch. ### Using new Kubernetes dependencies @@ -83,21 +83,20 @@ need them in older releases as they are not necessary to manage workload cluster run the Cluster API controllers on the new Kubernetes version. * [ ] Ensure there is a new controller-runtime minor release which uses the new Kubernetes Go dependencies. -* [ ] Update our Prow jobs for the `main` branch to use the correct `kubekins-e2e` image via the configuration file and by running `make generate-test-infra-prowjobs`. +* [ ] Update our ProwJobs for the `main` branch to use the `kubekins-e2e` with the correct Kubernetes version via [cluster-api-prowjob-gen.yaml](https://github.com/kubernetes/test-infra/blob/master/config/jobs/kubernetes-sigs/cluster-api/cluster-api-prowjob-gen.yaml) and by running `make generate-test-infra-prowjobs`. * It is recommended to have one PR for presubmit and one for periodic jobs to reduce the risk of breaking the periodic jobs. * Prior art: https://github.com/kubernetes/test-infra/pull/32380 * [ ] Bump the Go version in Cluster API: (if Kubernetes is using a new Go minor version) * Search for the currently used Go version across the repository and update it * We have to at least modify it in: `hack/ensure-go.sh`, `.golangci.yml`, `cloudbuild*.yaml`, `go.mod`, `Makefile`, `netlify.toml`, `Tiltfile` - * Prior art: #10452 -* [ ] Bump controller-runtime -* [ ] Bump controller-tools + * Prior art: https://github.com/kubernetes-sigs/cluster-api/pull/10452 +* [ ] Bumps in Cluster API repo: + * controller-runtime & controller-tools in go.mod files + * controller-gen via `CONTROLLER_GEN_VER` in `Makefile` + * conversion-gen via `CONVERSION_GEN_VER` in `Makefile` + * Prior art: https://github.com/kubernetes-sigs/cluster-api/pull/10803 * [ ] Bump the Kubernetes version used in integration tests via `KUBEBUILDER_ENVTEST_KUBERNETES_VERSION` in `Makefile` - * **Note**: This PR should be cherry-picked as well. It is part of this section as it depends on kubebuilder/controller-runtime - releases and is not strictly necessary for [Supporting managing and running on the new Kubernetes version](#supporting-managing-and-running-on-the-new-kubernetes-version). - * Prior art to release envtest binaries: https://github.com/kubernetes-sigs/kubebuilder/pull/3864 + * **Note**: This PR should be cherry-picked as well. It is part of this section as it depends on kubebuilder/controller-runtime releases and is not strictly necessary for [Supporting managing and running on the new Kubernetes version](#supporting-managing-and-running-on-the-new-kubernetes-version). + * Prior art to release envtest binaries: https://github.com/kubernetes-sigs/controller-tools/pull/1032 * Prior art: #7193 -* [ ] Bump conversion-gen via `CONVERSION_GEN_VER` in `Makefile` - * Prior art: #7118 -After release of CAPI v1.X.x (that supports Kubernetes v1.Y): diff --git a/exp/internal/controllers/machinepool_controller_phases_test.go b/exp/internal/controllers/machinepool_controller_phases_test.go index a995c2a95838..28e63204f045 100644 --- a/exp/internal/controllers/machinepool_controller_phases_test.go +++ b/exp/internal/controllers/machinepool_controller_phases_test.go @@ -36,6 +36,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/api/v1beta1/index" "sigs.k8s.io/cluster-api/controllers/external" "sigs.k8s.io/cluster-api/controllers/remote" expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" @@ -456,7 +457,7 @@ func TestReconcileMachinePoolPhases(t *testing.T) { {Kind: "Node", Name: "machinepool-test-node-3"}, } - fakeClient := fake.NewClientBuilder().WithObjects(defaultCluster, defaultKubeconfigSecret, machinepool, bootstrapConfig, infraConfig, builder.TestBootstrapConfigCRD, builder.TestInfrastructureMachineTemplateCRD).Build() + fakeClient := fake.NewClientBuilder().WithObjects(defaultCluster, defaultKubeconfigSecret, machinepool, bootstrapConfig, infraConfig, builder.TestBootstrapConfigCRD, builder.TestInfrastructureMachineTemplateCRD).WithIndex(&corev1.Node{}, index.NodeProviderIDField, index.NodeByProviderID).Build() r := &MachinePoolReconciler{ Client: fakeClient, Tracker: remote.NewTestClusterCacheTracker(logr.New(log.NullLogSink{}), fakeClient, fakeClient, fakeClient.Scheme(), client.ObjectKey{Name: defaultCluster.Name, Namespace: defaultCluster.Namespace}), @@ -586,7 +587,7 @@ func TestReconcileMachinePoolPhases(t *testing.T) { machinePool.Status.ReadyReplicas = 1 machinePool.Status.Replicas = 1 - fakeClient := fake.NewClientBuilder().WithObjects(defaultCluster, defaultKubeconfigSecret, machinePool, bootstrapConfig, infraConfig, builder.TestBootstrapConfigCRD, builder.TestInfrastructureMachineTemplateCRD).Build() + fakeClient := fake.NewClientBuilder().WithObjects(defaultCluster, defaultKubeconfigSecret, machinePool, bootstrapConfig, infraConfig, builder.TestBootstrapConfigCRD, builder.TestInfrastructureMachineTemplateCRD).WithIndex(&corev1.Node{}, index.NodeProviderIDField, index.NodeByProviderID).Build() r := &MachinePoolReconciler{ Client: fakeClient, Tracker: remote.NewTestClusterCacheTracker(logr.New(log.NullLogSink{}), fakeClient, fakeClient, fakeClient.Scheme(), client.ObjectKey{Name: defaultCluster.Name, Namespace: defaultCluster.Namespace}), @@ -672,7 +673,7 @@ func TestReconcileMachinePoolPhases(t *testing.T) { machinePool.Status.ReadyReplicas = 1 machinePool.Status.Replicas = 1 - fakeClient := fake.NewClientBuilder().WithObjects(defaultCluster, defaultKubeconfigSecret, machinePool, bootstrapConfig, infraConfig, builder.TestBootstrapConfigCRD, builder.TestInfrastructureMachineTemplateCRD).Build() + fakeClient := fake.NewClientBuilder().WithObjects(defaultCluster, defaultKubeconfigSecret, machinePool, bootstrapConfig, infraConfig, builder.TestBootstrapConfigCRD, builder.TestInfrastructureMachineTemplateCRD).WithIndex(&corev1.Node{}, index.NodeProviderIDField, index.NodeByProviderID).Build() r := &MachinePoolReconciler{ Client: fakeClient, Tracker: remote.NewTestClusterCacheTracker(logr.New(log.NullLogSink{}), fakeClient, fakeClient, fakeClient.Scheme(), client.ObjectKey{Name: defaultCluster.Name, Namespace: defaultCluster.Namespace}), @@ -1997,7 +1998,7 @@ func TestReconcileMachinePoolScaleToFromZero(t *testing.T) { err = unstructured.SetNestedField(infraConfig.Object, int64(1), "status", "replicas") g.Expect(err).ToNot(HaveOccurred()) - fakeClient := fake.NewClientBuilder().WithObjects(testCluster, kubeconfigSecret, machinepool, bootstrapConfig, infraConfig, builder.TestBootstrapConfigCRD, builder.TestInfrastructureMachineTemplateCRD).Build() + fakeClient := fake.NewClientBuilder().WithObjects(testCluster, kubeconfigSecret, machinepool, bootstrapConfig, infraConfig, builder.TestBootstrapConfigCRD, builder.TestInfrastructureMachineTemplateCRD).WithIndex(&corev1.Node{}, index.NodeProviderIDField, index.NodeByProviderID).Build() r := &MachinePoolReconciler{ Client: fakeClient, Tracker: remote.NewTestClusterCacheTracker(logr.New(log.NullLogSink{}), env.GetClient(), env.GetClient(), env.GetClient().Scheme(), client.ObjectKey{Name: testCluster.Name, Namespace: testCluster.Namespace}), diff --git a/exp/internal/controllers/machinepool_controller_test.go b/exp/internal/controllers/machinepool_controller_test.go index aa9de43469e9..478fb7d53c03 100644 --- a/exp/internal/controllers/machinepool_controller_test.go +++ b/exp/internal/controllers/machinepool_controller_test.go @@ -36,6 +36,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/reconcile" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/api/v1beta1/index" "sigs.k8s.io/cluster-api/controllers/remote" expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/internal/test/builder" @@ -548,7 +549,7 @@ func TestReconcileMachinePoolRequest(t *testing.T) { } return nil }, - }).WithObjects(trackerObjects...).Build() + }).WithObjects(trackerObjects...).WithIndex(&corev1.Node{}, index.NodeProviderIDField, index.NodeByProviderID).Build() r := &MachinePoolReconciler{ Client: clientFake, @@ -1090,7 +1091,7 @@ func TestMachinePoolConditions(t *testing.T) { &nodes.Items[1], builder.TestBootstrapConfigCRD, builder.TestInfrastructureMachineTemplateCRD, - ).WithStatusSubresource(&expv1.MachinePool{}).Build() + ).WithStatusSubresource(&expv1.MachinePool{}).WithIndex(&corev1.Node{}, index.NodeProviderIDField, index.NodeByProviderID).Build() r := &MachinePoolReconciler{ Client: clientFake,