Skip to content

Commit 26c3586

Browse files
clebsbryan-coxchrischdi
authored
🌱 Bump CAPI to v1.11 and k8s to v1.33 (#5720)
* deps: upgrade Kubernetes dependencies to v0.33.4 - Update core Kubernetes dependencies from v0.32.3 to v0.33.4: - k8s.io/api, k8s.io/apimachinery, k8s.io/client-go - k8s.io/apiserver, k8s.io/cli-runtime, k8s.io/kubectl - k8s.io/apiextensions-apiserver, k8s.io/component-base - Upgrade prometheus/client_golang from v1.19.1 to v1.22.0 - Update cel.dev/expr from v0.18.0 to v0.19.1 - Upgrade google/cel-go from v0.22.0 to v0.23.2 - Update golang.org/x/time from v0.8.0 to v0.9.0 - Upgrade gRPC from v1.67.3 to v1.68.1 - Update OpenTelemetry packages to v1.33.0 - Refresh k8s.io/utils and other indirect dependencies - Update kube-openapi and structured-merge-diff versions * deps: update cluster-api to v1.11.1 and controller-runtime to v0.21.0 - Upgrade cluster-api from v1.10.2 to v1.11.1 - Upgrade controller-runtime from v0.20.4 to v0.21.0 - Update various golang.org/x/* packages - Update testing dependencies (ginkgo, gomega) - Update OpenTelemetry and other indirect dependencies * WIP no IDE errors * WIP IDE Errors * Fix go dependencies Signed-off-by: Borja Clemente <[email protected]> * Update imports, code and generations to CAPI 1.11 - Update all imports to v1beta2 types except for conditions staying in v1beta1. - Adapt source code to work with v1beta2 and deprecated conditions. - Manually update conversions. Signed-off-by: Borja Clemente <[email protected]> * Update linting pkg alias and fix broken imports blocks Signed-off-by: Borja Clemente <[email protected]> * Remove unnecessary Paused constants Signed-off-by: Borja Clemente <[email protected]> * Fix import aliases Signed-off-by: Borja Clemente <[email protected]> * Fix broken imports Signed-off-by: Borja Clemente <[email protected]> * Revert public APIS back to v1beta1 while internally using v1beta2 Introducing v1beta2 on public types is a breaking change so they have to stay in v1beta1. Internally though, migration to v1beta2 is happening (except for conditions). Signed-off-by: Borja Clemente <[email protected]> * Revert infrav1 conditions to v1beta1 and consolidate imports Signed-off-by: Borja Clemente <[email protected]> * Consolidate conditions imports and fix linting Signed-off-by: Borja Clemente <[email protected]> * Fix regression in machine deployments without failure domain set Signed-off-by: Borja Clemente <[email protected]> * Revert missing public APIs to v1beta1 Signed-off-by: Borja Clemente <[email protected]> * Consolidate infrav1beta1 imports into infrav1 Signed-off-by: Borja Clemente <[email protected]> * Remove unused conditions constants Signed-off-by: Borja Clemente <[email protected]> * Fix setting wrong condition type Signed-off-by: Borja Clemente <[email protected]> * Cast v1beta1 conditions instead of creating a new constant Signed-off-by: Borja Clemente <[email protected]> * Revert changed public APIs and adapt internally to v1beta2 Signed-off-by: Borja Clemente <[email protected]> * Resolve conflicts with main Signed-off-by: Borja Clemente <[email protected]> * Add deprecated CAPI imports linter rule Add rule to allow using deprecated v1beta1 CAPI APIs and removed linter comments everywhere. Signed-off-by: Borja Clemente <[email protected]> * Apply review corrections Signed-off-by: Borja Clemente <[email protected]> * Adjust e2e and metadata versions Signed-off-by: Borja Clemente <[email protected]> * Apply review feedback on awscluster_webhook Signed-off-by: Borja Clemente <[email protected]> * FIx unit tests Signed-off-by: Borja Clemente <[email protected]> * Review feedback Signed-off-by: Borja Clemente <[email protected]> * Apply review feedback Signed-off-by: Borja Clemente <[email protected]> * Add CRD RBAC to the awsmachine controller Signed-off-by: Borja Clemente <[email protected]> * e2e: add v1beta1 CAPI scheme to clients and adjust modifyFunc test to use the new field name * Fix linting issues Signed-off-by: Borja Clemente <[email protected]> * Fix nodeDrainTimeoutSeconds field in clusterclass test Signed-off-by: Borja Clemente <[email protected]> * e2e: fix contract for CAPI * fix path again * e2e: fix contract for capa 9.99.99 (#3) * e2e: use correct type for setting field (#4) * rosa: deflake unit test (#5) * rosa: deflake unit test * fixup * e2e: fix config metadata and contract version pinning (#6) * e2e: fix config metadata file path Signed-off-by: Borja Clemente <[email protected]> * Bump KCP Template for clusterclass changes (#7) --------- Signed-off-by: Borja Clemente <[email protected]> Co-authored-by: Bryan Cox <[email protected]> Co-authored-by: Christian Schlotter <[email protected]>
1 parent 5b67a67 commit 26c3586

File tree

193 files changed

+2439
-1974
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+2439
-1974
lines changed

.golangci.yml

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,6 @@ linters:
139139
alias: runtimeserializer
140140
- pkg: k8s.io/apimachinery/pkg/runtime/serializer/yaml
141141
alias: yamlserializer
142-
- pkg: sigs.k8s.io/cluster-api/api/v1beta1
143-
alias: clusterv1
144142
- pkg: sigs.k8s.io/cluster-api/util/defaulting
145143
alias: utildefaulting
146144
- pkg: sigs.k8s.io/controller-runtime
@@ -169,8 +167,14 @@ linters:
169167
alias: crclient
170168
- pkg: k8s.io/apimachinery/pkg/types
171169
alias: apimachinerytypes
172-
- pkg: sigs.k8s.io/cluster-api/exp/api/v1beta1
173-
alias: expclusterv1
170+
- pkg: "sigs.k8s.io/cluster-api/api/core/v1beta2"
171+
alias: clusterv1
172+
- pkg: "sigs.k8s.io/cluster-api/api/core/v1beta1"
173+
alias: clusterv1beta1
174+
- pkg: "sigs.k8s.io/cluster-api/util/deprecated/v1beta1/patch"
175+
alias: v1beta1patch
176+
- pkg: "sigs.k8s.io/cluster-api/util/deprecated/v1beta1/conditions"
177+
alias: v1beta1conditions
174178
no-unaliased: false
175179
nolintlint:
176180
require-specific: true
@@ -212,16 +216,16 @@ linters:
212216
# - errcheck
213217
# text: Error return value of `outputPrinter.Print` is not checked
214218
- linters:
215-
- gosec
216-
text: 'G103: Use of unsafe calls should be audited'
219+
- gosec
220+
text: "G103: Use of unsafe calls should be audited"
217221
path: .*(api|types|test)\/.*\/.*conversion.*\.go$
218222
- linters:
219223
- staticcheck
220-
text: 'QF1008: could remove embedded field .*'
224+
text: "QF1008: could remove embedded field .*"
221225
# TODO: change to use time.Time.Equal
222226
- linters:
223227
- staticcheck
224-
text: 'QF1009: probably want to use time.Time.Equal instead'
228+
text: "QF1009: probably want to use time.Time.Equal instead"
225229
- linters:
226230
- revive
227231
# Ignoring stylistic checks for generated code
@@ -233,13 +237,13 @@ linters:
233237
# Ignoring stylistic checks for generated code
234238
path: .*(api|types)\/.*\/.*conversion.*\.go$
235239
# By convention, receiver names in a method should reflect their identity.
236-
text: 'receiver-naming: receiver name (.+) should be consistent with previous receiver name (.+)'
240+
text: "receiver-naming: receiver name (.+) should be consistent with previous receiver name (.+)"
237241
- linters:
238242
- revive
239243
# Ignoring stylistic checks for generated code
240244
path: .*(api|types|test)\/.*\/.*conversion.*\.go$
241245
# Checking if an error is nil to just after return the error or nil is redundant
242-
text: 'if-return: redundant if ...; err != nil check, just return error instead'
246+
text: "if-return: redundant if ...; err != nil check, just return error instead"
243247
- linters:
244248
- revive
245249
text: 'exported: exported method .*\.(Reconcile|SetupWithManager|SetupWebhookWithManager) should have comment or be unexported'
@@ -268,7 +272,7 @@ linters:
268272
text: Error return value of (.+) is not checked
269273
- linters:
270274
- gosec
271-
text: 'G108: Profiling endpoint is automatically exposed on /debug/pprof'
275+
text: "G108: Profiling endpoint is automatically exposed on /debug/pprof"
272276
- linters:
273277
- godot
274278
path: (.*)/(v1beta1|v1beta2)/(.*)types.go
@@ -282,17 +286,17 @@ linters:
282286
- linters:
283287
- revive
284288
path: .*/defaults.go
285-
text: 'var-naming: don''t use underscores in Go names; func (.+) should be (.+)'
289+
text: "var-naming: don't use underscores in Go names; func (.+) should be (.+)"
286290
- linters:
287291
- revive
288292
path: .*/.*(mock|gc_).*/.+\.go
289-
text: 'var-naming: don''t use an underscore in package name'
293+
text: "var-naming: don't use an underscore in package name"
290294
- linters:
291295
- revive
292296
# Ignoring stylistic checks for generated code
293297
path: .*(api|types|test)\/.*\/.*conversion.*\.go$
294298
# This rule warns when initialism, variable or package naming conventions are not followed.
295-
text: 'var-naming: don''t use underscores in Go names'
299+
text: "var-naming: don't use underscores in Go names"
296300
- linters:
297301
- unparam
298302
text: always receives
@@ -309,20 +313,23 @@ linters:
309313
text: cyclomatic complexity
310314
- linters:
311315
- gocritic
312-
text: 'appendAssign: append result not assigned to the same slice'
316+
text: "appendAssign: append result not assigned to the same slice"
313317
- path: (.+)\.go$
314318
text: (Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less)
315319
- path: (.+)\.go$
316-
text: 'exported: (func|type) name will be used as (.+) by other packages, and that stutters; consider calling this (.+)'
320+
text: "exported: (func|type) name will be used as (.+) by other packages, and that stutters; consider calling this (.+)"
317321
- path: (.+)\.go$
318322
text: (G104|G107|G404|G505|ST1000)
319323
- path: (.+)\.go$
320-
text: 'G108: Profiling endpoint is automatically exposed on /debug/pprof'
324+
text: "G108: Profiling endpoint is automatically exposed on /debug/pprof"
321325
- path: (.+)\.go$
322326
text: net/http.Get must not be called
323327
- linters:
324328
- goconst
325329
path: (.+)_test\.go
330+
- linters:
331+
- staticcheck
332+
text: 'SA1019: "sigs.k8s.io/cluster-api/(.*)" is deprecated: This package is deprecated and is going to be removed when support for v1beta1 will be dropped.'
326333
paths:
327334
- third_party$
328335
- builtin$

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ endif
205205
.PHONY: defaulters
206206
defaulters: $(DEFAULTER_GEN) ## Generate all Go types
207207
$(DEFAULTER_GEN) \
208-
--extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1beta1 \
208+
--extra-peer-dirs=sigs.k8s.io/cluster-api/api/core/v1beta2 \
209209
--v=0 \
210210
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt \
211211
--output-file=zz_generated.defaults.go \
@@ -263,36 +263,36 @@ generate-go-apis: ## Alias for .build/generate-go-apis
263263
$(MAKE) defaulters
264264

265265
$(CONVERSION_GEN) \
266-
--extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1beta1 \
266+
--extra-peer-dirs=sigs.k8s.io/cluster-api/api/core/v1beta2 \
267267
--output-file=zz_generated.conversion.go \
268268
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt \
269269
./api/v1beta1 \
270270
./cmd/clusterawsadm/api/bootstrap/v1alpha1
271271

272272
$(CONVERSION_GEN) \
273273
--extra-peer-dirs=sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1 \
274-
--extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1beta1 \
274+
--extra-peer-dirs=sigs.k8s.io/cluster-api/api/core/v1beta2 \
275275
--output-file=zz_generated.conversion.go \
276276
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt \
277277
./$(EXP_DIR)/api/v1beta1
278278

279279
$(CONVERSION_GEN) \
280280
--extra-peer-dirs=sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1 \
281-
--extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1beta1 \
281+
--extra-peer-dirs=sigs.k8s.io/cluster-api/api/core/v1beta2 \
282282
--output-file=zz_generated.conversion.go \
283283
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt \
284284
./bootstrap/eks/api/v1beta1
285285

286286
$(CONVERSION_GEN) \
287287
--extra-peer-dirs=sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1 \
288-
--extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1beta1 \
288+
--extra-peer-dirs=sigs.k8s.io/cluster-api/api/core/v1beta2 \
289289
--output-file=zz_generated.conversion.go \
290290
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt \
291291
./controlplane/eks/api/v1beta1
292292

293293
$(CONVERSION_GEN) \
294294
--extra-peer-dirs=sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1 \
295-
--extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1beta1 \
295+
--extra-peer-dirs=sigs.k8s.io/cluster-api/api/core/v1beta2 \
296296
--output-file=zz_generated.conversion.go \
297297
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt \
298298
./controlplane/rosa/api/v1beta2

api/v1beta1/awscluster_types.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package v1beta1
1919
import (
2020
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2121

22-
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
22+
clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1"
2323
)
2424

2525
const (
@@ -45,7 +45,7 @@ type AWSClusterSpec struct {
4545

4646
// ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.
4747
// +optional
48-
ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint"`
48+
ControlPlaneEndpoint clusterv1beta1.APIEndpoint `json:"controlPlaneEndpoint"`
4949

5050
// AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the
5151
// ones added by default.
@@ -200,11 +200,11 @@ type AWSLoadBalancerSpec struct {
200200
// AWSClusterStatus defines the observed state of AWSCluster.
201201
type AWSClusterStatus struct {
202202
// +kubebuilder:default=false
203-
Ready bool `json:"ready"`
204-
Network NetworkStatus `json:"networkStatus,omitempty"`
205-
FailureDomains clusterv1.FailureDomains `json:"failureDomains,omitempty"`
206-
Bastion *Instance `json:"bastion,omitempty"`
207-
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
203+
Ready bool `json:"ready"`
204+
Network NetworkStatus `json:"networkStatus,omitempty"`
205+
FailureDomains clusterv1beta1.FailureDomains `json:"failureDomains,omitempty"`
206+
Bastion *Instance `json:"bastion,omitempty"`
207+
Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"`
208208
}
209209

210210
// S3Bucket defines a supporting S3 bucket for the cluster, currently can be optionally used for Ignition.
@@ -254,12 +254,12 @@ type AWSClusterList struct {
254254
}
255255

256256
// GetConditions returns the observations of the operational state of the AWSCluster resource.
257-
func (r *AWSCluster) GetConditions() clusterv1.Conditions {
257+
func (r *AWSCluster) GetConditions() clusterv1beta1.Conditions {
258258
return r.Status.Conditions
259259
}
260260

261-
// SetConditions sets the underlying service state of the AWSCluster to the predescribed clusterv1.Conditions.
262-
func (r *AWSCluster) SetConditions(conditions clusterv1.Conditions) {
261+
// SetConditions sets the underlying service state of the AWSCluster to the predescribed clusterv1beta1.Conditions.
262+
func (r *AWSCluster) SetConditions(conditions clusterv1beta1.Conditions) {
263263
r.Status.Conditions = conditions
264264
}
265265

api/v1beta1/awsclustertemplate_types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package v1beta1
1919
import (
2020
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2121

22-
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
22+
clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1"
2323
)
2424

2525
// AWSClusterTemplateSpec defines the desired state of AWSClusterTemplate.
@@ -58,6 +58,6 @@ type AWSClusterTemplateResource struct {
5858
// Standard object's metadata.
5959
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
6060
// +optional
61-
ObjectMeta clusterv1.ObjectMeta `json:"metadata,omitempty"`
62-
Spec AWSClusterSpec `json:"spec"`
61+
ObjectMeta clusterv1beta1.ObjectMeta `json:"metadata,omitempty"`
62+
Spec AWSClusterSpec `json:"spec"`
6363
}

api/v1beta1/awsmachine_types.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package v1beta1
1919
import (
2020
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2121

22-
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
22+
clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1"
2323
)
2424

2525
const (
@@ -207,7 +207,7 @@ type AWSMachineStatus struct {
207207
Interruptible bool `json:"interruptible,omitempty"`
208208

209209
// Addresses contains the AWS instance associated addresses.
210-
Addresses []clusterv1.MachineAddress `json:"addresses,omitempty"`
210+
Addresses []clusterv1beta1.MachineAddress `json:"addresses,omitempty"`
211211

212212
// InstanceState is the state of the AWS instance for this machine.
213213
// +optional
@@ -253,7 +253,7 @@ type AWSMachineStatus struct {
253253

254254
// Conditions defines current service state of the AWSMachine.
255255
// +optional
256-
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
256+
Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"`
257257
}
258258

259259
// +kubebuilder:object:root=true
@@ -276,12 +276,12 @@ type AWSMachine struct {
276276
}
277277

278278
// GetConditions returns the observations of the operational state of the AWSMachine resource.
279-
func (r *AWSMachine) GetConditions() clusterv1.Conditions {
279+
func (r *AWSMachine) GetConditions() clusterv1beta1.Conditions {
280280
return r.Status.Conditions
281281
}
282282

283-
// SetConditions sets the underlying service state of the AWSMachine to the predescribed clusterv1.Conditions.
284-
func (r *AWSMachine) SetConditions(conditions clusterv1.Conditions) {
283+
// SetConditions sets the underlying service state of the AWSMachine to the predescribed clusterv1beta1.Conditions.
284+
func (r *AWSMachine) SetConditions(conditions clusterv1beta1.Conditions) {
285285
r.Status.Conditions = conditions
286286
}
287287

api/v1beta1/awsmachinetemplate_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
corev1 "k8s.io/api/core/v1"
2121
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2222

23-
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
23+
clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1"
2424
)
2525

2626
// AWSMachineTemplateStatus defines a status for an AWSMachineTemplate.
@@ -65,7 +65,7 @@ type AWSMachineTemplateResource struct {
6565
// Standard object's metadata.
6666
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
6767
// +optional
68-
ObjectMeta clusterv1.ObjectMeta `json:"metadata,omitempty"`
68+
ObjectMeta clusterv1beta1.ObjectMeta `json:"metadata,omitempty"`
6969

7070
// Spec is the specification of the desired behavior of the machine.
7171
Spec AWSMachineSpec `json:"spec"`

0 commit comments

Comments
 (0)