Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -303,3 +303,7 @@ require (
sigs.k8s.io/kube-storage-version-migrator v0.0.6-0.20230721195810-5c8923c5ff96 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.7.0 // indirect
)

replace sigs.k8s.io/cluster-api-provider-aws/v2 => github.com/openshift-splat-team/cluster-api-provider-aws/v2 v2.0.0-20250912141505-d5a03c3dd2ed

replace github.com/openshift/api => github.com/vr4manta/api v0.0.0-20250929154722-9355a7602b96
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,8 @@ github.com/onsi/ginkgo/v2 v2.23.4 h1:ktYTpKJAVZnDT4VjxSbiBenUjmlL/5QkBEocaWXiQus
github.com/onsi/ginkgo/v2 v2.23.4/go.mod h1:Bt66ApGPBFzHyR+JO10Zbt0Gsp4uWxu5mIOTusL46e8=
github.com/onsi/gomega v1.38.0 h1:c/WX+w8SLAinvuKKQFh77WEucCnPk4j2OTUr7lt7BeY=
github.com/onsi/gomega v1.38.0/go.mod h1:OcXcwId0b9QsE7Y49u+BTrL4IdKOBOKnD6VQNTJEB6o=
github.com/openshift/api v0.0.0-20250731015415-ed654edbd7c6 h1:Tgb04NUifdOs+6m/OOe0a1FcoIFMScI3tMJ8grnfb90=
github.com/openshift/api v0.0.0-20250731015415-ed654edbd7c6/go.mod h1:SPLf21TYPipzCO67BURkCfK6dcIIxx0oNRVWaOyRcXM=
github.com/openshift-splat-team/cluster-api-provider-aws/v2 v2.0.0-20250912141505-d5a03c3dd2ed h1:Aex9kayKTNwdLQbtVDWey0n+vVww07HNietP6TxGqxA=
github.com/openshift-splat-team/cluster-api-provider-aws/v2 v2.0.0-20250912141505-d5a03c3dd2ed/go.mod h1:BHUiinQAEJQJpocfGJNdbN40AA3Q5tRhltjfV4aIs68=
github.com/openshift/client-go v0.0.0-20250710075018-396b36f983ee h1:tOtrrxfDEW8hK3eEsHqxsXurq/D6LcINGfprkQC3hqY=
github.com/openshift/client-go v0.0.0-20250710075018-396b36f983ee/go.mod h1:zhRiYyNMk89llof2qEuGPWPD+joQPhCRUc2IK0SB510=
github.com/openshift/cluster-api-actuator-pkg/testutils v0.0.0-20250821122144-fd0936342469 h1:2Nb7w9xhgZg/ahmvrG4Y/+6Tp/Gfj7KGZZKAupKah8g=
Expand Down Expand Up @@ -569,6 +569,8 @@ github.com/uudashr/gocognit v1.2.0 h1:3BU9aMr1xbhPlvJLSydKwdLN3tEUUrzPSSM8S4hDYR
github.com/uudashr/gocognit v1.2.0/go.mod h1:k/DdKPI6XBZO1q7HgoV2juESI2/Ofj9AcHPZhBBdrTU=
github.com/uudashr/iface v1.3.1 h1:bA51vmVx1UIhiIsQFSNq6GZ6VPTk3WNMZgRiCe9R29U=
github.com/uudashr/iface v1.3.1/go.mod h1:4QvspiRd3JLPAEXBQ9AiZpLbJlrWWgRChOKDJEuQTdg=
github.com/vr4manta/api v0.0.0-20250929154722-9355a7602b96 h1:B1sDjz+OYr4DLrz2GpiC3o8+l//3V5XbdnXauKhD+6M=
github.com/vr4manta/api v0.0.0-20250929154722-9355a7602b96/go.mod h1:SPLf21TYPipzCO67BURkCfK6dcIIxx0oNRVWaOyRcXM=
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
github.com/xen0n/gosmopolitan v1.2.2 h1:/p2KTnMzwRexIW8GlKawsTWOxn7UHA+jCMF/V8HHtvU=
Expand Down Expand Up @@ -811,8 +813,6 @@ sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.32.0 h1:XotDXzqvJ8Nx5
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.32.0/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw=
sigs.k8s.io/cluster-api v1.10.4 h1:5mdyWLGbbwOowWrjqM/J9N600QnxTohu5J1/1YR6g7c=
sigs.k8s.io/cluster-api v1.10.4/go.mod h1:68GJs286ZChsncp+TxYNj/vhy2NWokiPtH4+SA0afs0=
sigs.k8s.io/cluster-api-provider-aws/v2 v2.9.0 h1:oP4GkhI4K/STwtt/Uzt6UdOnn+xMXhk7v3BJfr+dSx4=
sigs.k8s.io/cluster-api-provider-aws/v2 v2.9.0/go.mod h1:wdqD8SRkgbIAoj0L2geEItos4X4xmCr8yQpEOqIwLp4=
sigs.k8s.io/cluster-api-provider-azure v1.20.2 h1:+7BUb0zj0ICrI+P6NKw9txVV/iMS+R+4wRx+HvIVLQY=
sigs.k8s.io/cluster-api-provider-azure v1.20.2/go.mod h1:ZqjFzJm2/7rveKakQtC7h4L0p7sk5u3zylRLW1NmL50=
sigs.k8s.io/cluster-api-provider-gcp v1.10.0 h1:gngUxo9bz8l+otpdw9v3ULEXwAvijyqiBx2v8HSoRwA=
Expand Down
35 changes: 30 additions & 5 deletions pkg/conversion/capi2mapi/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ var (
)

const (
errUnsupportedCAPATenancy = "unable to convert tenancy, unknown value"
errUnsupportedCAPAMarketType = "unable to convert market type, unknown value"
errUnsupportedHTTPTokensState = "unable to convert httpTokens state, unknown value" //nolint:gosec // This is an error message, not a credential
defaultIdentityName = "default"
defaultCredentialsSecretName = "aws-cloud-credentials" //#nosec G101 -- False positive, not actually a credential.
errUnsupportedCAPATenancy = "unable to convert tenancy, unknown value"
errUnsupportedCAPAMarketType = "unable to convert market type, unknown value"
errUnsupportedHTTPTokensState = "unable to convert httpTokens state, unknown value" //nolint:gosec // This is an error message, not a credential
defaultIdentityName = "default"
defaultCredentialsSecretName = "aws-cloud-credentials" //#nosec G101 -- False positive, not actually a credential.
errUnsupportedHostAffinityType = "unable to convert hostAffinity, unknown value"
)

// machineAndAWSMachineAndAWSCluster stores the details of a Cluster API Machine and AWSMachine and AWSCluster.
Expand Down Expand Up @@ -156,6 +157,21 @@ func (m machineAndAWSMachineAndAWSCluster) toProviderSpec() (*mapiv1.AWSMachineP
MarketType: mapiAWSMarketType,
}

// Dedicated host support
if m.awsMachine.Spec.HostID != nil {
mapaProviderConfig.HostID = m.awsMachine.Spec.HostID
}
if m.awsMachine.Spec.HostAffinity != nil {
switch *m.awsMachine.Spec.HostAffinity {
case "host":
*mapaProviderConfig.HostAffinity = mapiv1.HostAffinityHost
case "default":
*mapaProviderConfig.HostAffinity = mapiv1.HostAffinityAnyAvailable
default:
errors = append(errors, field.Invalid(fldPath.Child("hostAffinity"), m.awsMachine.Spec.HostAffinity, errUnsupportedHostAffinityType))
}
}

secretRef, errs := handleAWSIdentityRef(fldPath.Child("identityRef"), m.awsCluster.Spec.IdentityRef)

if len(errs) > 0 {
Expand Down Expand Up @@ -525,6 +541,15 @@ func handleUnsupportedAWSMachineFields(fldPath *field.Path, spec awsv1.AWSMachin
errs = append(errs, field.Invalid(fldPath.Child("privateDNSName"), spec.PrivateDNSName, "privateDNSName is not supported"))
}

// Unsupported new fields in newer CAPA versions
if spec.ElasticIPPool != nil {
errs = append(errs, field.Invalid(fldPath.Child("elasticIpPool"), spec.ElasticIPPool, "elasticIpPool is not supported"))
}

if spec.CapacityReservationPreference != "" {
errs = append(errs, field.Invalid(fldPath.Child("capacityReservationPreference"), spec.CapacityReservationPreference, "capacityReservationPreference is not supported"))
}

if spec.Ignition != nil {
if spec.Ignition.Proxy != nil {
// Ignition proxy is not configurable in MAPI. Not required for our use case.
Expand Down
11 changes: 11 additions & 0 deletions pkg/conversion/mapi2capi/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,17 @@ func (m *awsMachineAndInfra) toAWSMachine(providerSpec mapiv1.AWSMachineProvider
MarketType: capiAWSMarketType,
}

// Dedicated host support
if providerSpec.HostID != nil {
spec.HostID = providerSpec.HostID
}
if providerSpec.HostAffinity != nil {
spec.HostAffinity = ptr.To(string(*providerSpec.HostAffinity))
}
if providerSpec.HostAffinity != nil && providerSpec.HostID == nil {
errs = append(errs, field.Invalid(fldPath.Child("hostAffinity"), providerSpec.HostAffinity, "hostAffinity requires hostID to be set"))
}

if providerSpec.CapacityReservationID != "" {
spec.CapacityReservationID = &providerSpec.CapacityReservationID
}
Expand Down
26 changes: 22 additions & 4 deletions vendor/github.com/openshift/api/.golangci.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/openshift/api/OWNERS

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading