Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
6e71718
fix: bump golangci-lint to work with go 1.24+ to v2.7.0
faiq Dec 8, 2025
8eada65
Merge pull request #5803 from k8s-infra-cherrypick-robot/cherry-pick-…
k8s-ci-robot Dec 22, 2025
e6eb7f0
fix: change HostAffinity default 'host'->'default', improve API doc a…
damdo Dec 19, 2025
7aa98ea
Merge pull request #5802 from k8s-infra-cherrypick-robot/cherry-pick-…
k8s-ci-robot Dec 23, 2025
be25668
Allow ROSA NodePool autoscaling MinReplicas to be 0
jhjaggars Jan 13, 2026
4c185c1
Merge pull request #5839 from k8s-infra-cherrypick-robot/cherry-pick-…
k8s-ci-robot Jan 20, 2026
2d98c3b
Add logForward config AND imageTypes
serngawy Nov 28, 2025
e5ef525
Merge pull request #5840 from k8s-infra-cherrypick-robot/cherry-pick-…
k8s-ci-robot Jan 21, 2026
141ba60
Fix flaky test TestROSARoleConfigReconcileExist
serngawy Jan 21, 2026
1be6889
Merge pull request #5847 from k8s-infra-cherrypick-robot/cherry-pick-…
k8s-ci-robot Jan 23, 2026
f82f359
webhook server: use tlsconfig from the manager options
damdo Jan 23, 2026
fd1ef27
Merge pull request #5849 from k8s-infra-cherrypick-robot/cherry-pick-…
k8s-ci-robot Jan 23, 2026
dc07b5c
merge upstream/v2.10.1 into main
Feb 9, 2026
1f0d634
UPSTREAM: <carry>: Add openshift specific changes
alexander-demicev Jan 7, 2022
11a69d9
UPSTREAM: <carry>: manifests: add vap for infraclusters: vendor
damdo Sep 4, 2024
0f1f46d
UPSTREAM: <carry>: manifests: add vap for infraclusters
damdo Sep 4, 2024
f153d27
UPSTREAM: <carry>: OWNERS: update subcomponent
damdo Sep 4, 2024
3117b52
UPSTREAM: <carry>: Updating ose-aws-cluster-api-controllers-container…
Sep 5, 2024
c263d26
UPSTREAM: <carry>: Updating ose-aws-cluster-api-controllers-container…
Dec 6, 2024
d716f56
UPSTREAM: <carry>: Remove unnecessary kustomize
RadekManak Feb 24, 2025
ab38e60
UPSTREAM: <carry>: Update manifests generator tooling
RadekManak Feb 24, 2025
b58b36e
UPSTREAM: <carry>: update go mod dependency for konflux
ashwindasr Apr 4, 2025
6cc58be
UPSTREAM: <carry>: Update manifests-gen dependency
JoelSpeed May 9, 2025
4e2f769
UPSTREAM: <carry>: Update generated manifests
JoelSpeed May 9, 2025
7e7b202
UPSTREAM: <carry>: Reference main branch for CI
nrb May 12, 2025
90264f9
UPSTREAM: <carry>: Sync OWNERS file
JoelSpeed Jul 22, 2025
70d7be2
UPSTREAM: <carry>: Updating ose-aws-cluster-api-controllers-container…
Jun 20, 2025
6ca776f
UPSTREAM: <carry>: Sync OWNERS file
RadekManak Sep 4, 2025
03ed7ca
UPSTREAM: <carry>: Updating ose-aws-cluster-api-controllers-container…
Sep 30, 2025
7de76c1
UPSTREAM: <carry>: openshift: rename manager binary
damdo Nov 17, 2025
d1b053d
UPSTREAM: <carry>: Updating ose-aws-cluster-api-controllers-container…
Dec 20, 2025
eabc4b4
UPSTREAM: <carry>: Add manifests verify target
RadekManak Dec 9, 2025
35877c3
UPSTREAM: <drop>: Update manifests generator
Feb 9, 2026
3f62888
UPSTREAM: <drop>: Generate OpenShift manifests
Feb 9, 2026
8077add
UPSTREAM: <drop>: Updating and vendoring go modules after an upstream…
Feb 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .github/workflows/pr-golangci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@0a35821d5c230e903fcfe077583637dea1b27b47 # tag=v9.0.0
with:
version: v2.1.0
version: v2.7.0
working-directory: ${{matrix.working-directory}}
- name: Lint API
run: make lint-api
35 changes: 35 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,38 @@ linters:
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"
- linters:
- revive
path: 'exp/utils/*'
text: 'var-naming: avoid meaningless package names'
- linters:
- revive
path: 'cmd/clusterawsadm/cmd/ami/common'
text: 'var-naming: avoid meaningless package names'
- linters:
- revive
path: 'cmd/clusterawsadm/cmd/util'
text: 'var-naming: avoid meaningless package names'
- linters:
- revive
path: 'pkg/utils'
text: 'var-naming: avoid meaningless package names'
- linters:
- revive
path: 'pkg/cloud/services/common/'
text: 'var-naming: avoid meaningless package names'
- linters:
- revive
path: 'test/e2e/shared/'
text: 'var-naming: avoid meaningless package names'
- linters:
- revive
text: 'avoid package names that conflict with Go standard library package names'
path: 'pkg/internal/bytes/'
- linters:
- revive
text: 'avoid package names that conflict with Go standard library package names'
path: 'pkg/hash/'
- linters:
- unparam
text: always receives
Expand Down Expand Up @@ -330,6 +362,9 @@ linters:
- 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.'
- linters:
- staticcheck
text: "s.scope.ControlPlaneLoadBalancer is deprecated"
paths:
- third_party$
- builtin$
Expand Down
1 change: 1 addition & 0 deletions api/v1beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type AWSResourceReference struct {

// ARN of resource.
// +optional
//
// Deprecated: This field has no function and is going to be removed in the next release.
ARN *string `json:"arn,omitempty"`

Expand Down
14 changes: 9 additions & 5 deletions api/v1beta2/awsmachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,18 +251,22 @@ type AWSMachineSpec struct {
HostID *string `json:"hostID,omitempty"`

// HostAffinity specifies the dedicated host affinity setting for the instance.
// When HostAffinity is set to host, an instance started onto a specific host always restarts on the same host if stopped.
// When HostAffinity is set to default, and you stop and restart the instance, it can be restarted on any available host.
// When HostAffinity is defined, HostID is required.
// When HostAffinity is set to "host", an instance started onto a specific host always restarts on the same host if stopped:
// - If HostID is set, the instance launches on the specific host and must return to that same host after any stop/start (Targeted & Pinned).
// - If HostID is not set, the instance gets launched on any available and must returns to the same host after any stop/start (Auto-placed & Pinned).
// When HostAffinity is set to "default" (the default value), the instance (when restarted) can return on any available host:
// - If HostID is set, the instance launches on the specified host now, but (when restarted) can return to any available hosts (Targeted & Flexible).
// - If HostID is not set, the instance launches on any available host now, and (when restarted) can return to any available hosts (Auto-placed & Flexible).
// If HostAffinity is not specified, it defaults to "default".
// +optional
// +kubebuilder:validation:Enum:=default;host
// +kubebuilder:default=host
// +kubebuilder:default=default
HostAffinity *string `json:"hostAffinity,omitempty"`

// DynamicHostAllocation enables automatic allocation of a single dedicated host.
// This field is mutually exclusive with HostID and always allocates exactly one host.
// Cost effectiveness of allocating a single instance on a dedicated host may vary
// depending on the instance type and the region.
// This field is mutually exclusive with HostID and always allocates exactly one host.
// +optional
DynamicHostAllocation *DynamicHostAllocationSpec `json:"dynamicHostAllocation,omitempty"`

Expand Down
1 change: 1 addition & 0 deletions api/v1beta2/awsmachine_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ func (r *AWSMachine) validateHostAllocation() field.ErrorList {
hasHostID := r.Spec.HostID != nil && len(*r.Spec.HostID) > 0
hasDynamicHostAllocation := r.Spec.DynamicHostAllocation != nil

// If both hostID and dynamicHostAllocation are specified, return an error
if hasHostID && hasDynamicHostAllocation {
allErrs = append(allErrs, field.Forbidden(field.NewPath("spec.hostID"), "hostID and dynamicHostAllocation are mutually exclusive"), field.Forbidden(field.NewPath("spec.dynamicHostAllocation"), "hostID and dynamicHostAllocation are mutually exclusive"))
}
Expand Down
165 changes: 123 additions & 42 deletions api/v1beta2/awsmachine_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,61 @@ func TestAWSMachineCreate(t *testing.T) {
wantErr: true,
},
{
name: "configure host affinity with Host ID",
name: "hostAffinity=invalid is invalid",
machine: &AWSMachine{
Spec: AWSMachineSpec{
InstanceType: "test",
HostAffinity: ptr.To("invalid"),
},
},
wantErr: true,
},
{
name: "hostAffinity=host does not require hostID or dynamicHostAllocation",
machine: &AWSMachine{
Spec: AWSMachineSpec{
InstanceType: "test",
HostAffinity: ptr.To("host"),
},
},
wantErr: false,
},
{
name: "hostAffinity=host with hostID is valid",
machine: &AWSMachine{
Spec: AWSMachineSpec{
InstanceType: "test",
HostAffinity: ptr.To("host"),
HostID: ptr.To("h-09dcf61cb388b0149"),
},
},
wantErr: false,
},
{
name: "hostAffinity=host with dynamicHostAllocation is valid",
machine: &AWSMachine{
Spec: AWSMachineSpec{
InstanceType: "test",
HostAffinity: ptr.To("host"),
DynamicHostAllocation: &DynamicHostAllocationSpec{
Tags: map[string]string{"env": "test"},
},
},
},
wantErr: false,
},
{
name: "hostAffinity=default without hostID and dynamicHostAllocation is valid",
machine: &AWSMachine{
Spec: AWSMachineSpec{
InstanceType: "test",
HostAffinity: ptr.To("default"),
},
},
wantErr: false,
},
{
name: "hostAffinity=default with hostID is valid",
machine: &AWSMachine{
Spec: AWSMachineSpec{
InstanceType: "test",
Expand All @@ -480,11 +534,77 @@ func TestAWSMachineCreate(t *testing.T) {
wantErr: false,
},
{
name: "configure host affinity with invalid affinity",
name: "hostAffinity=default with dynamicHostAllocation is valid",
machine: &AWSMachine{
Spec: AWSMachineSpec{
InstanceType: "test",
HostAffinity: ptr.To("invalid"),
HostAffinity: ptr.To("default"),
DynamicHostAllocation: &DynamicHostAllocationSpec{
Tags: map[string]string{"env": "test"},
},
},
},
wantErr: false,
},
{
name: "hostAffinity omitted (=default) without hostID and dynamicHostAllocation is valid",
machine: &AWSMachine{
Spec: AWSMachineSpec{
InstanceType: "test",
},
},
wantErr: false,
},
{
name: "hostAffinity omitted (=default) with hostID is valid",
machine: &AWSMachine{
Spec: AWSMachineSpec{
InstanceType: "test",
HostID: ptr.To("h-09dcf61cb388b0149"),
},
},
wantErr: false,
},
{
name: "hostAffinity omitted (=default) with dynamicHostAllocation is valid",
machine: &AWSMachine{
Spec: AWSMachineSpec{
InstanceType: "test",
DynamicHostAllocation: &DynamicHostAllocationSpec{
Tags: map[string]string{"env": "test"},
},
},
},
wantErr: false,
},
{
name: "hostAffinity=host with both hostID and dynamicHostAllocation is not valid (mutually exclusive)",
machine: &AWSMachine{
Spec: AWSMachineSpec{
InstanceType: "test",
HostAffinity: ptr.To("host"),
HostID: aws.String("h-1234567890abcdef0"),
DynamicHostAllocation: &DynamicHostAllocationSpec{
Tags: map[string]string{
"Environment": "test",
},
},
},
},
wantErr: true,
},
{
name: "hostAffinity=default with both hostID and dynamicHostAllocation is not valid (mutually exclusive)",
machine: &AWSMachine{
Spec: AWSMachineSpec{
InstanceType: "test",
HostAffinity: ptr.To("default"),
HostID: aws.String("h-1234567890abcdef0"),
DynamicHostAllocation: &DynamicHostAllocationSpec{
Tags: map[string]string{
"Environment": "test",
},
},
},
},
wantErr: true,
Expand Down Expand Up @@ -557,45 +677,6 @@ func TestAWSMachineCreate(t *testing.T) {
},
wantErr: true,
},
{
name: "hostID and dynamicHostAllocation are mutually exclusive",
machine: &AWSMachine{
Spec: AWSMachineSpec{
InstanceType: "test",
HostID: aws.String("h-1234567890abcdef0"),
DynamicHostAllocation: &DynamicHostAllocationSpec{
Tags: map[string]string{
"Environment": "test",
},
},
},
},
wantErr: true,
},
{
name: "hostID alone is valid",
machine: &AWSMachine{
Spec: AWSMachineSpec{
InstanceType: "test",
HostID: aws.String("h-1234567890abcdef0"),
},
},
wantErr: false,
},
{
name: "dynamicHostAllocation alone is valid",
machine: &AWSMachine{
Spec: AWSMachineSpec{
InstanceType: "test",
DynamicHostAllocation: &DynamicHostAllocationSpec{
Tags: map[string]string{
"Environment": "test",
},
},
},
},
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down
5 changes: 5 additions & 0 deletions api/v1beta2/awsmachinetemplate_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,11 @@ func (r *AWSMachineTemplate) validateHostAllocation() field.ErrorList {
allErrs = append(allErrs, field.Forbidden(field.NewPath("spec.template.spec.hostID"), "hostID and dynamicHostAllocation are mutually exclusive"), field.Forbidden(field.NewPath("spec.template.spec.dynamicHostAllocation"), "hostID and dynamicHostAllocation are mutually exclusive"))
}

// When hostAffinity is "host", either hostID or dynamicHostAllocation must be specified
if spec.HostAffinity != nil && *spec.HostAffinity == "host" && !hasHostID && !hasDynamicHostAllocation {
allErrs = append(allErrs, field.Required(field.NewPath("spec.template.spec.hostID"), "hostID or dynamicHostAllocation must be set when hostAffinity is 'host'"))
}

return allErrs
}

Expand Down
64 changes: 64 additions & 0 deletions api/v1beta2/awsmachinetemplate_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,70 @@ func TestAWSMachineTemplateValidateCreate(t *testing.T) {
},
wantError: true,
},
{
name: "hostAffinity=host requires hostID or dynamicHostAllocation",
inputTemplate: &AWSMachineTemplate{
ObjectMeta: metav1.ObjectMeta{},
Spec: AWSMachineTemplateSpec{
Template: AWSMachineTemplateResource{
Spec: AWSMachineSpec{
InstanceType: "test",
HostAffinity: ptr.To("host"),
},
},
},
},
wantError: true,
},
{
name: "hostAffinity=host with hostID is valid",
inputTemplate: &AWSMachineTemplate{
ObjectMeta: metav1.ObjectMeta{},
Spec: AWSMachineTemplateSpec{
Template: AWSMachineTemplateResource{
Spec: AWSMachineSpec{
InstanceType: "test",
HostAffinity: ptr.To("host"),
HostID: ptr.To("h-09dcf61cb388b0149"),
},
},
},
},
wantError: false,
},
{
name: "hostAffinity=host with dynamicHostAllocation is valid",
inputTemplate: &AWSMachineTemplate{
ObjectMeta: metav1.ObjectMeta{},
Spec: AWSMachineTemplateSpec{
Template: AWSMachineTemplateResource{
Spec: AWSMachineSpec{
InstanceType: "test",
HostAffinity: ptr.To("host"),
DynamicHostAllocation: &DynamicHostAllocationSpec{
Tags: map[string]string{"env": "test"},
},
},
},
},
},
wantError: false,
},
{
name: "hostAffinity=default without hostID is valid",
inputTemplate: &AWSMachineTemplate{
ObjectMeta: metav1.ObjectMeta{},
Spec: AWSMachineTemplateSpec{
Template: AWSMachineTemplateResource{
Spec: AWSMachineSpec{
InstanceType: "test",
HostAffinity: ptr.To("default"),
},
},
},
},
wantError: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down
9 changes: 6 additions & 3 deletions api/v1beta2/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,12 @@ type Instance struct {
MarketType MarketType `json:"marketType,omitempty"`

// HostAffinity specifies the dedicated host affinity setting for the instance.
// When hostAffinity is set to host, an instance started onto a specific host always restarts on the same host if stopped.
// When hostAffinity is set to default, and you stop and restart the instance, it can be restarted on any available host.
// When HostAffinity is defined, HostID is required.
// When HostAffinity is set to "host", an instance started onto a specific host always restarts on the same host if stopped:
// - If HostID is set, the instance launches on the specific host and must return to that same host after any stop/start (Targeted & Pinned).
// - If HostID is not set, the instance gets launched on any available and must returns to the same host after any stop/start (Auto-placed & Pinned).
// When HostAffinity is set to "default" (the default value), the instance (when restarted) can return on any available host:
// - If HostID is set, the instance launches on the specified host now, but (when restarted) can return to any available hosts (Targeted & Flexible).
// - If HostID is not set, the instance launches on any available host now, and (when restarted) can return to any available hosts (Auto-placed & Flexible).
// +optional
// +kubebuilder:validation:Enum:=default;host
HostAffinity *string `json:"hostAffinity,omitempty"`
Expand Down
Loading