Skip to content

OCPCLOUD-2914: Add MAPI to CAPI migration to TechPreview #2279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 24, 2025
Merged
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
2 changes: 1 addition & 1 deletion features.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
| ------ | --- | --- | --- | --- | --- | --- |
| ClusterAPIInstall| | | | | | |
| EventedPLEG| | | | | | |
| MachineAPIMigration| | | | | | |
| MachineAPIOperatorDisableMachineHealthCheckController| | | | | | |
| MultiArchInstallAzure| | | | | | |
| ClusterVersionOperatorConfiguration| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | |
Expand Down Expand Up @@ -39,6 +38,7 @@
| InsightsOnDemandDataGather| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| InsightsRuntimeExtractor| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| KMSEncryptionProvider| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| MachineAPIMigration| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| MachineAPIProviderOpenStack| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| MachineConfigNodes| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| MaxUnavailableStatefulSet| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
Expand Down
1 change: 1 addition & 0 deletions features/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@ var (
contactPerson("jspeed").
productScope(ocpSpecific).
enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()

FeatureGatePersistentIPsForVirtualization = newFeatureGate("PersistentIPsForVirtualization").
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: "ControlPlaneMachineSet (+CPMSMachineNamePrefix)"
crdName: controlplanemachinesets.machine.openshift.io
featureGates:
- CPMSMachineNamePrefix
- -MachineAPIMigration
tests:
onCreate:
- name: Should be able to create a minimal ControlPlaneMachineSet
Expand All @@ -24,6 +23,7 @@ tests:
machine.openshift.io/cluster-api-machine-type: master
machine.openshift.io/cluster-api-cluster: cluster
spec:
authoritativeAPI: MachineAPI
providerSpec: {}
expected: |
apiVersion: machine.openshift.io/v1
Expand All @@ -46,6 +46,7 @@ tests:
machine.openshift.io/cluster-api-machine-type: master
machine.openshift.io/cluster-api-cluster: cluster
spec:
authoritativeAPI: MachineAPI
providerSpec: {}
- name: Should be able to create ControlPlaneMachineSet with machineNamePrefix
initial: |
Expand All @@ -66,6 +67,7 @@ tests:
machine.openshift.io/cluster-api-machine-type: master
machine.openshift.io/cluster-api-cluster: cluster
spec:
authoritativeAPI: MachineAPI
providerSpec: {}
expected: |
apiVersion: machine.openshift.io/v1
Expand All @@ -89,6 +91,7 @@ tests:
machine.openshift.io/cluster-api-machine-type: master
machine.openshift.io/cluster-api-cluster: cluster
spec:
authoritativeAPI: MachineAPI
providerSpec: {}
- name: Should reject to create ControlPlaneMachineSet with empty machineNamePrefix
initial: |
Expand All @@ -109,6 +112,7 @@ tests:
machine.openshift.io/cluster-api-machine-type: master
machine.openshift.io/cluster-api-cluster: cluster
spec:
authoritativeAPI: MachineAPI
providerSpec: {}
expectedError: 'Invalid value: "": spec.machineNamePrefix in body should be at least 1 chars long'
- name: Should reject to create ControlPlaneMachineSet with invalid machineNamePrefix
Expand All @@ -130,6 +134,7 @@ tests:
machine.openshift.io/cluster-api-machine-type: master
machine.openshift.io/cluster-api-cluster: cluster
spec:
authoritativeAPI: MachineAPI
providerSpec: {}
expectedError: 'Invalid value: "string": a lowercase RFC 1123 subdomain must consist of lowercase alphanumeric characters, hyphens (''-''), and periods (''.''). Each block, separated by periods, must start and end with an alphanumeric character. Hyphens are not allowed at the start or end of a block, and consecutive periods are not permitted.'
- name: Should reject to create ControlPlaneMachineSet with invalid machineNamePrefix - Consecutive periods are not permitted
Expand All @@ -151,5 +156,6 @@ tests:
machine.openshift.io/cluster-api-machine-type: master
machine.openshift.io/cluster-api-cluster: cluster
spec:
authoritativeAPI: MachineAPI
providerSpec: {}
expectedError: 'Invalid value: "string": a lowercase RFC 1123 subdomain must consist of lowercase alphanumeric characters, hyphens (''-''), and periods (''.''). Each block, separated by periods, must start and end with an alphanumeric character. Hyphens are not allowed at the start or end of a block, and consecutive periods are not permitted.'
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,20 @@ spec:
failure domain field. This will be overriden when the Machines
are created based on the FailureDomains field.
properties:
authoritativeAPI:
default: MachineAPI
description: |-
authoritativeAPI is the API that is authoritative for this resource.
Valid values are MachineAPI and ClusterAPI.
When set to MachineAPI, writes to the spec of the machine.openshift.io copy of this resource will be reflected into the cluster.x-k8s.io copy.
When set to ClusterAPI, writes to the spec of the cluster.x-k8s.io copy of this resource will be reflected into the machine.openshift.io copy.
Updates to the status will be reflected in both copies of the resource, based on the controller implementing the functionality of the API.
Currently the authoritative API determines which controller will manage the resource, this will change in a future release.
To ensure the change has been accepted, please verify that the `status.authoritativeAPI` field has been updated to the desired value and that the `Synchronized` condition is present and set to `True`.
enum:
- MachineAPI
- ClusterAPI
type: string
lifecycleHooks:
description: |-
lifecycleHooks allow users to pause operations on the machine at
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,20 @@ spec:
failure domain field. This will be overriden when the Machines
are created based on the FailureDomains field.
properties:
authoritativeAPI:
default: MachineAPI
description: |-
authoritativeAPI is the API that is authoritative for this resource.
Valid values are MachineAPI and ClusterAPI.
When set to MachineAPI, writes to the spec of the machine.openshift.io copy of this resource will be reflected into the cluster.x-k8s.io copy.
When set to ClusterAPI, writes to the spec of the cluster.x-k8s.io copy of this resource will be reflected into the machine.openshift.io copy.
Updates to the status will be reflected in both copies of the resource, based on the controller implementing the functionality of the API.
Currently the authoritative API determines which controller will manage the resource, this will change in a future release.
To ensure the change has been accepted, please verify that the `status.authoritativeAPI` field has been updated to the desired value and that the `Synchronized` condition is present and set to `True`.
enum:
- MachineAPI
- ClusterAPI
type: string
lifecycleHooks:
description: |-
lifecycleHooks allow users to pause operations on the machine at
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,20 @@ spec:
spec:
description: MachineSpec defines the desired state of Machine
properties:
authoritativeAPI:
default: MachineAPI
description: |-
authoritativeAPI is the API that is authoritative for this resource.
Valid values are MachineAPI and ClusterAPI.
When set to MachineAPI, writes to the spec of the machine.openshift.io copy of this resource will be reflected into the cluster.x-k8s.io copy.
When set to ClusterAPI, writes to the spec of the cluster.x-k8s.io copy of this resource will be reflected into the machine.openshift.io copy.
Updates to the status will be reflected in both copies of the resource, based on the controller implementing the functionality of the API.
Currently the authoritative API determines which controller will manage the resource, this will change in a future release.
To ensure the change has been accepted, please verify that the `status.authoritativeAPI` field has been updated to the desired value and that the `Synchronized` condition is present and set to `True`.
enum:
- MachineAPI
- ClusterAPI
type: string
lifecycleHooks:
description: |-
lifecycleHooks allow users to pause operations on the machine at
Expand Down Expand Up @@ -364,6 +378,23 @@ spec:
type: object
type: array
x-kubernetes-list-type: atomic
authoritativeAPI:
description: |-
authoritativeAPI is the API that is authoritative for this resource.
Valid values are MachineAPI, ClusterAPI and Migrating.
This value is updated by the migration controller to reflect the authoritative API.
Machine API and Cluster API controllers use this value to determine whether or not to reconcile the resource.
When set to Migrating, the migration controller is currently performing the handover of authority from one API to the other.
enum:
- MachineAPI
- ClusterAPI
- Migrating
type: string
x-kubernetes-validations:
- message: The authoritativeAPI field must not transition directly
from MachineAPI to ClusterAPI or vice versa. It must transition
through Migrating.
rule: self == 'Migrating' || self == oldSelf || oldSelf == 'Migrating'
conditions:
description: conditions defines the current state of the Machine
items:
Expand Down Expand Up @@ -537,7 +568,23 @@ spec:
serialized/deserialized from this field.
type: object
x-kubernetes-preserve-unknown-fields: true
synchronizedGeneration:
description: |-
synchronizedGeneration is the generation of the authoritative resource that the non-authoritative resource is synchronised with.
This field is set when the authoritative resource is updated and the sync controller has updated the non-authoritative resource to match.
format: int64
minimum: 0
type: integer
type: object
x-kubernetes-validations:
- fieldPath: .synchronizedGeneration
message: synchronizedGeneration must not decrease unless authoritativeAPI
is transitioning from Migrating to another value
reason: FieldValueInvalid
rule: '!has(oldSelf.synchronizedGeneration) || (has(self.synchronizedGeneration)
&& self.synchronizedGeneration >= oldSelf.synchronizedGeneration)
|| (oldSelf.authoritativeAPI == ''Migrating'' && self.authoritativeAPI
!= ''Migrating'')'
type: object
served: true
storage: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,20 @@ spec:
spec:
description: MachineSpec defines the desired state of Machine
properties:
authoritativeAPI:
default: MachineAPI
description: |-
authoritativeAPI is the API that is authoritative for this resource.
Valid values are MachineAPI and ClusterAPI.
When set to MachineAPI, writes to the spec of the machine.openshift.io copy of this resource will be reflected into the cluster.x-k8s.io copy.
When set to ClusterAPI, writes to the spec of the cluster.x-k8s.io copy of this resource will be reflected into the machine.openshift.io copy.
Updates to the status will be reflected in both copies of the resource, based on the controller implementing the functionality of the API.
Currently the authoritative API determines which controller will manage the resource, this will change in a future release.
To ensure the change has been accepted, please verify that the `status.authoritativeAPI` field has been updated to the desired value and that the `Synchronized` condition is present and set to `True`.
enum:
- MachineAPI
- ClusterAPI
type: string
lifecycleHooks:
description: |-
lifecycleHooks allow users to pause operations on the machine at
Expand Down Expand Up @@ -364,6 +378,23 @@ spec:
type: object
type: array
x-kubernetes-list-type: atomic
authoritativeAPI:
description: |-
authoritativeAPI is the API that is authoritative for this resource.
Valid values are MachineAPI, ClusterAPI and Migrating.
This value is updated by the migration controller to reflect the authoritative API.
Machine API and Cluster API controllers use this value to determine whether or not to reconcile the resource.
When set to Migrating, the migration controller is currently performing the handover of authority from one API to the other.
enum:
- MachineAPI
- ClusterAPI
- Migrating
type: string
x-kubernetes-validations:
- message: The authoritativeAPI field must not transition directly
from MachineAPI to ClusterAPI or vice versa. It must transition
through Migrating.
rule: self == 'Migrating' || self == oldSelf || oldSelf == 'Migrating'
conditions:
description: conditions defines the current state of the Machine
items:
Expand Down Expand Up @@ -537,7 +568,23 @@ spec:
serialized/deserialized from this field.
type: object
x-kubernetes-preserve-unknown-fields: true
synchronizedGeneration:
description: |-
synchronizedGeneration is the generation of the authoritative resource that the non-authoritative resource is synchronised with.
This field is set when the authoritative resource is updated and the sync controller has updated the non-authoritative resource to match.
format: int64
minimum: 0
type: integer
type: object
x-kubernetes-validations:
- fieldPath: .synchronizedGeneration
message: synchronizedGeneration must not decrease unless authoritativeAPI
is transitioning from Migrating to another value
reason: FieldValueInvalid
rule: '!has(oldSelf.synchronizedGeneration) || (has(self.synchronizedGeneration)
&& self.synchronizedGeneration >= oldSelf.synchronizedGeneration)
|| (oldSelf.authoritativeAPI == ''Migrating'' && self.authoritativeAPI
!= ''Migrating'')'
type: object
served: true
storage: true
Expand Down
Loading