Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
432afd8
deps: upgrade Kubernetes dependencies to v0.33.4
bryan-cox Sep 5, 2025
6c277a3
deps: update cluster-api to v1.11.1 and controller-runtime to v0.21.0
bryan-cox Sep 5, 2025
cef8a4d
WIP no IDE errors
bryan-cox Sep 5, 2025
e5f0d8f
WIP IDE Errors
bryan-cox Sep 5, 2025
454cc67
Fix go dependencies
clebs Oct 16, 2025
ce62bbc
Update imports, code and generations to CAPI 1.11
clebs Oct 23, 2025
0b8bf56
Update linting pkg alias and fix broken imports blocks
clebs Oct 23, 2025
1491bcb
Remove unnecessary Paused constants
clebs Oct 24, 2025
d35c4ab
Fix import aliases
clebs Oct 24, 2025
bd9f9f4
Fix broken imports
clebs Oct 24, 2025
5ad2783
Revert public APIS back to v1beta1 while internally using v1beta2
clebs Oct 27, 2025
6c66522
Revert infrav1 conditions to v1beta1 and consolidate imports
clebs Oct 27, 2025
3a3dc37
Consolidate conditions imports and fix linting
clebs Oct 27, 2025
54e4777
Fix regression in machine deployments without failure domain set
clebs Oct 27, 2025
dcc5efe
Revert missing public APIs to v1beta1
clebs Oct 27, 2025
71840b7
Consolidate infrav1beta1 imports into infrav1
clebs Oct 27, 2025
8ad6446
Remove unused conditions constants
clebs Oct 27, 2025
4c5e489
Fix setting wrong condition type
clebs Oct 27, 2025
6944e51
Cast v1beta1 conditions instead of creating a new constant
clebs Oct 30, 2025
d329175
Revert changed public APIs and adapt internally to v1beta2
clebs Nov 4, 2025
fd6e22a
Resolve conflicts with main
clebs Nov 4, 2025
e3e4196
Add deprecated CAPI imports linter rule
clebs Nov 7, 2025
7e08d67
Apply review corrections
clebs Nov 7, 2025
3664d96
Adjust e2e and metadata versions
clebs Nov 7, 2025
5169bd4
Apply review feedback on awscluster_webhook
clebs Nov 12, 2025
0d2f5dc
FIx unit tests
clebs Nov 13, 2025
15706dd
Review feedback
clebs Nov 13, 2025
b721c59
Apply review feedback
clebs Nov 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 24 additions & 17 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ linters:
alias: runtimeserializer
- pkg: k8s.io/apimachinery/pkg/runtime/serializer/yaml
alias: yamlserializer
- pkg: sigs.k8s.io/cluster-api/api/v1beta1
alias: clusterv1
- pkg: sigs.k8s.io/cluster-api/util/defaulting
alias: utildefaulting
- pkg: sigs.k8s.io/controller-runtime
Expand Down Expand Up @@ -169,8 +167,14 @@ linters:
alias: crclient
- pkg: k8s.io/apimachinery/pkg/types
alias: apimachinerytypes
- pkg: sigs.k8s.io/cluster-api/exp/api/v1beta1
alias: expclusterv1
- pkg: "sigs.k8s.io/cluster-api/api/core/v1beta2"
alias: clusterv1
- pkg: "sigs.k8s.io/cluster-api/api/core/v1beta1"
alias: clusterv1beta1
- pkg: "sigs.k8s.io/cluster-api/util/deprecated/v1beta1/patch"
alias: v1beta1patch
- pkg: "sigs.k8s.io/cluster-api/util/deprecated/v1beta1/conditions"
alias: v1beta1conditions
no-unaliased: false
nolintlint:
require-specific: true
Expand Down Expand Up @@ -212,16 +216,16 @@ linters:
# - errcheck
# text: Error return value of `outputPrinter.Print` is not checked
- linters:
- gosec
text: 'G103: Use of unsafe calls should be audited'
- gosec
text: "G103: Use of unsafe calls should be audited"
path: .*(api|types|test)\/.*\/.*conversion.*\.go$
- linters:
- staticcheck
text: 'QF1008: could remove embedded field .*'
text: "QF1008: could remove embedded field .*"
# TODO: change to use time.Time.Equal
- linters:
- staticcheck
text: 'QF1009: probably want to use time.Time.Equal instead'
text: "QF1009: probably want to use time.Time.Equal instead"
- linters:
- revive
# Ignoring stylistic checks for generated code
Expand All @@ -233,13 +237,13 @@ linters:
# Ignoring stylistic checks for generated code
path: .*(api|types)\/.*\/.*conversion.*\.go$
# By convention, receiver names in a method should reflect their identity.
text: 'receiver-naming: receiver name (.+) should be consistent with previous receiver name (.+)'
text: "receiver-naming: receiver name (.+) should be consistent with previous receiver name (.+)"
- linters:
- revive
# Ignoring stylistic checks for generated code
path: .*(api|types|test)\/.*\/.*conversion.*\.go$
# Checking if an error is nil to just after return the error or nil is redundant
text: 'if-return: redundant if ...; err != nil check, just return error instead'
text: "if-return: redundant if ...; err != nil check, just return error instead"
- linters:
- revive
text: 'exported: exported method .*\.(Reconcile|SetupWithManager|SetupWebhookWithManager) should have comment or be unexported'
Expand Down Expand Up @@ -268,7 +272,7 @@ linters:
text: Error return value of (.+) is not checked
- linters:
- gosec
text: 'G108: Profiling endpoint is automatically exposed on /debug/pprof'
text: "G108: Profiling endpoint is automatically exposed on /debug/pprof"
- linters:
- godot
path: (.*)/(v1beta1|v1beta2)/(.*)types.go
Expand All @@ -282,17 +286,17 @@ linters:
- linters:
- revive
path: .*/defaults.go
text: 'var-naming: don''t use underscores in Go names; func (.+) should be (.+)'
text: "var-naming: don't use underscores in Go names; func (.+) should be (.+)"
- linters:
- revive
path: .*/.*(mock|gc_).*/.+\.go
text: 'var-naming: don''t use an underscore in package name'
text: "var-naming: don't use an underscore in package name"
- linters:
- revive
# Ignoring stylistic checks for generated code
path: .*(api|types|test)\/.*\/.*conversion.*\.go$
# This rule warns when initialism, variable or package naming conventions are not followed.
text: 'var-naming: don''t use underscores in Go names'
text: "var-naming: don't use underscores in Go names"
- linters:
- unparam
text: always receives
Expand All @@ -309,20 +313,23 @@ linters:
text: cyclomatic complexity
- linters:
- gocritic
text: 'appendAssign: append result not assigned to the same slice'
text: "appendAssign: append result not assigned to the same slice"
- path: (.+)\.go$
text: (Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less)
- path: (.+)\.go$
text: 'exported: (func|type) name will be used as (.+) by other packages, and that stutters; consider calling this (.+)'
text: "exported: (func|type) name will be used as (.+) by other packages, and that stutters; consider calling this (.+)"
- path: (.+)\.go$
text: (G104|G107|G404|G505|ST1000)
- path: (.+)\.go$
text: 'G108: Profiling endpoint is automatically exposed on /debug/pprof'
text: "G108: Profiling endpoint is automatically exposed on /debug/pprof"
- path: (.+)\.go$
text: net/http.Get must not be called
- linters:
- goconst
path: (.+)_test\.go
- linters:
- staticcheck
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.'
paths:
- third_party$
- builtin$
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ endif
.PHONY: defaulters
defaulters: $(DEFAULTER_GEN) ## Generate all Go types
$(DEFAULTER_GEN) \
--extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1beta1 \
--extra-peer-dirs=sigs.k8s.io/cluster-api/api/core/v1beta2 \
--v=0 \
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt \
--output-file=zz_generated.defaults.go \
Expand Down Expand Up @@ -263,36 +263,36 @@ generate-go-apis: ## Alias for .build/generate-go-apis
$(MAKE) defaulters

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

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

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

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

$(CONVERSION_GEN) \
--extra-peer-dirs=sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1 \
--extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1beta1 \
--extra-peer-dirs=sigs.k8s.io/cluster-api/api/core/v1beta2 \
--output-file=zz_generated.conversion.go \
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt \
./controlplane/rosa/api/v1beta2
Expand Down
20 changes: 10 additions & 10 deletions api/v1beta1/awscluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1"
)

const (
Expand All @@ -45,7 +45,7 @@ type AWSClusterSpec struct {

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

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

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

// GetConditions returns the observations of the operational state of the AWSCluster resource.
func (r *AWSCluster) GetConditions() clusterv1.Conditions {
func (r *AWSCluster) GetConditions() clusterv1beta1.Conditions {
return r.Status.Conditions
}

// SetConditions sets the underlying service state of the AWSCluster to the predescribed clusterv1.Conditions.
func (r *AWSCluster) SetConditions(conditions clusterv1.Conditions) {
// SetConditions sets the underlying service state of the AWSCluster to the predescribed clusterv1beta1.Conditions.
func (r *AWSCluster) SetConditions(conditions clusterv1beta1.Conditions) {
r.Status.Conditions = conditions
}

Expand Down
6 changes: 3 additions & 3 deletions api/v1beta1/awsclustertemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1"
)

// AWSClusterTemplateSpec defines the desired state of AWSClusterTemplate.
Expand Down Expand Up @@ -58,6 +58,6 @@ type AWSClusterTemplateResource struct {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
ObjectMeta clusterv1.ObjectMeta `json:"metadata,omitempty"`
Spec AWSClusterSpec `json:"spec"`
ObjectMeta clusterv1beta1.ObjectMeta `json:"metadata,omitempty"`
Spec AWSClusterSpec `json:"spec"`
}
12 changes: 6 additions & 6 deletions api/v1beta1/awsmachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1"
)

const (
Expand Down Expand Up @@ -207,7 +207,7 @@ type AWSMachineStatus struct {
Interruptible bool `json:"interruptible,omitempty"`

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

// InstanceState is the state of the AWS instance for this machine.
// +optional
Expand Down Expand Up @@ -253,7 +253,7 @@ type AWSMachineStatus struct {

// Conditions defines current service state of the AWSMachine.
// +optional
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"`
}

// +kubebuilder:object:root=true
Expand All @@ -276,12 +276,12 @@ type AWSMachine struct {
}

// GetConditions returns the observations of the operational state of the AWSMachine resource.
func (r *AWSMachine) GetConditions() clusterv1.Conditions {
func (r *AWSMachine) GetConditions() clusterv1beta1.Conditions {
return r.Status.Conditions
}

// SetConditions sets the underlying service state of the AWSMachine to the predescribed clusterv1.Conditions.
func (r *AWSMachine) SetConditions(conditions clusterv1.Conditions) {
// SetConditions sets the underlying service state of the AWSMachine to the predescribed clusterv1beta1.Conditions.
func (r *AWSMachine) SetConditions(conditions clusterv1beta1.Conditions) {
r.Status.Conditions = conditions
}

Expand Down
4 changes: 2 additions & 2 deletions api/v1beta1/awsmachinetemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1"
)

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

// Spec is the specification of the desired behavior of the machine.
Spec AWSMachineSpec `json:"spec"`
Expand Down
Loading