diff --git a/machine/v1beta1/types_machine.go b/machine/v1beta1/types_machine.go index 33f472f9264..085c1062950 100644 --- a/machine/v1beta1/types_machine.go +++ b/machine/v1beta1/types_machine.go @@ -185,6 +185,18 @@ const ( MachineAuthorityMigrating MachineAuthority = "Migrating" ) +// SynchronizedAPI holds the last stable value of authoritativeAPI. +// +kubebuilder:validation:Enum=MachineAPI;ClusterAPI +type SynchronizedAPI string + +const ( + // MachineAPISynchronized indicates that the Machine API is the last synchronized API. + MachineAPISynchronized SynchronizedAPI = "MachineAPI" + + // ClusterAPISynchronized indicates that the Cluster API is the last synchronized API. + ClusterAPISynchronized SynchronizedAPI = "ClusterAPI" +) + // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -406,6 +418,14 @@ type MachineStatus struct { // +optional AuthoritativeAPI MachineAuthority `json:"authoritativeAPI,omitempty"` + // synchronizedAPI holds the last stable value of authoritativeAPI. + // It is used to detect migration cancellation requests and to restore the resource to its previous state. + // Valid values are "MachineAPI" and "ClusterAPI". + // When omitted, the resource has not yet been reconciled by the migration controller. + // +openshift:enable:FeatureGate=MachineAPIMigration + // +optional + SynchronizedAPI SynchronizedAPI `json:"synchronizedAPI,omitempty"` + // 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. // +kubebuilder:validation:Minimum=0 diff --git a/machine/v1beta1/types_machineset.go b/machine/v1beta1/types_machineset.go index a2343dc3982..69856b272d1 100644 --- a/machine/v1beta1/types_machineset.go +++ b/machine/v1beta1/types_machineset.go @@ -168,6 +168,14 @@ type MachineSetStatus struct { // +optional AuthoritativeAPI MachineAuthority `json:"authoritativeAPI,omitempty"` + // synchronizedAPI holds the last stable value of authoritativeAPI. + // It is used to detect migration cancellation requests and to restore the resource to its previous state. + // Valid values are "MachineAPI" and "ClusterAPI". + // When omitted, the resource has not yet been reconciled by the migration controller. + // +openshift:enable:FeatureGate=MachineAPIMigration + // +optional + SynchronizedAPI SynchronizedAPI `json:"synchronizedAPI,omitempty"` + // 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. // +kubebuilder:validation:Minimum=0 diff --git a/machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machines-CustomNoUpgrade.crd.yaml b/machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machines-CustomNoUpgrade.crd.yaml index d9e0dab848a..f3a8d1226bf 100644 --- a/machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machines-CustomNoUpgrade.crd.yaml +++ b/machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machines-CustomNoUpgrade.crd.yaml @@ -567,6 +567,16 @@ spec: serialized/deserialized from this field. type: object x-kubernetes-preserve-unknown-fields: true + synchronizedAPI: + description: |- + synchronizedAPI holds the last stable value of authoritativeAPI. + It is used to detect migration cancellation requests and to restore the resource to its previous state. + Valid values are "MachineAPI" and "ClusterAPI". + When omitted, the resource has not yet been reconciled by the migration controller. + enum: + - MachineAPI + - ClusterAPI + type: string synchronizedGeneration: description: |- synchronizedGeneration is the generation of the authoritative resource that the non-authoritative resource is synchronised with. diff --git a/machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machines-DevPreviewNoUpgrade.crd.yaml b/machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machines-DevPreviewNoUpgrade.crd.yaml index 3610c1f3e43..ab3889a0228 100644 --- a/machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machines-DevPreviewNoUpgrade.crd.yaml +++ b/machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machines-DevPreviewNoUpgrade.crd.yaml @@ -567,6 +567,16 @@ spec: serialized/deserialized from this field. type: object x-kubernetes-preserve-unknown-fields: true + synchronizedAPI: + description: |- + synchronizedAPI holds the last stable value of authoritativeAPI. + It is used to detect migration cancellation requests and to restore the resource to its previous state. + Valid values are "MachineAPI" and "ClusterAPI". + When omitted, the resource has not yet been reconciled by the migration controller. + enum: + - MachineAPI + - ClusterAPI + type: string synchronizedGeneration: description: |- synchronizedGeneration is the generation of the authoritative resource that the non-authoritative resource is synchronised with. diff --git a/machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machines-TechPreviewNoUpgrade.crd.yaml b/machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machines-TechPreviewNoUpgrade.crd.yaml index c26fa70b5de..16b686cf01e 100644 --- a/machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machines-TechPreviewNoUpgrade.crd.yaml +++ b/machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machines-TechPreviewNoUpgrade.crd.yaml @@ -567,6 +567,16 @@ spec: serialized/deserialized from this field. type: object x-kubernetes-preserve-unknown-fields: true + synchronizedAPI: + description: |- + synchronizedAPI holds the last stable value of authoritativeAPI. + It is used to detect migration cancellation requests and to restore the resource to its previous state. + Valid values are "MachineAPI" and "ClusterAPI". + When omitted, the resource has not yet been reconciled by the migration controller. + enum: + - MachineAPI + - ClusterAPI + type: string synchronizedGeneration: description: |- synchronizedGeneration is the generation of the authoritative resource that the non-authoritative resource is synchronised with. diff --git a/machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machinesets-CustomNoUpgrade.crd.yaml b/machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machinesets-CustomNoUpgrade.crd.yaml index 0809c028a56..ee7aab748f5 100644 --- a/machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machinesets-CustomNoUpgrade.crd.yaml +++ b/machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machinesets-CustomNoUpgrade.crd.yaml @@ -674,6 +674,16 @@ spec: description: replicas is the most recently observed number of replicas. format: int32 type: integer + synchronizedAPI: + description: |- + synchronizedAPI holds the last stable value of authoritativeAPI. + It is used to detect migration cancellation requests and to restore the resource to its previous state. + Valid values are "MachineAPI" and "ClusterAPI". + When omitted, the resource has not yet been reconciled by the migration controller. + enum: + - MachineAPI + - ClusterAPI + type: string synchronizedGeneration: description: |- synchronizedGeneration is the generation of the authoritative resource that the non-authoritative resource is synchronised with. diff --git a/machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machinesets-DevPreviewNoUpgrade.crd.yaml b/machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machinesets-DevPreviewNoUpgrade.crd.yaml index abfdbda0dde..2fa8b2c54d8 100644 --- a/machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machinesets-DevPreviewNoUpgrade.crd.yaml +++ b/machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machinesets-DevPreviewNoUpgrade.crd.yaml @@ -674,6 +674,16 @@ spec: description: replicas is the most recently observed number of replicas. format: int32 type: integer + synchronizedAPI: + description: |- + synchronizedAPI holds the last stable value of authoritativeAPI. + It is used to detect migration cancellation requests and to restore the resource to its previous state. + Valid values are "MachineAPI" and "ClusterAPI". + When omitted, the resource has not yet been reconciled by the migration controller. + enum: + - MachineAPI + - ClusterAPI + type: string synchronizedGeneration: description: |- synchronizedGeneration is the generation of the authoritative resource that the non-authoritative resource is synchronised with. diff --git a/machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machinesets-TechPreviewNoUpgrade.crd.yaml b/machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machinesets-TechPreviewNoUpgrade.crd.yaml index 0d59497ee56..3c998599464 100644 --- a/machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machinesets-TechPreviewNoUpgrade.crd.yaml +++ b/machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machinesets-TechPreviewNoUpgrade.crd.yaml @@ -674,6 +674,16 @@ spec: description: replicas is the most recently observed number of replicas. format: int32 type: integer + synchronizedAPI: + description: |- + synchronizedAPI holds the last stable value of authoritativeAPI. + It is used to detect migration cancellation requests and to restore the resource to its previous state. + Valid values are "MachineAPI" and "ClusterAPI". + When omitted, the resource has not yet been reconciled by the migration controller. + enum: + - MachineAPI + - ClusterAPI + type: string synchronizedGeneration: description: |- synchronizedGeneration is the generation of the authoritative resource that the non-authoritative resource is synchronised with. diff --git a/machine/v1beta1/zz_generated.featuregated-crd-manifests/machines.machine.openshift.io/MachineAPIMigration.yaml b/machine/v1beta1/zz_generated.featuregated-crd-manifests/machines.machine.openshift.io/MachineAPIMigration.yaml index c86dc4e94da..46cfac4a8c8 100644 --- a/machine/v1beta1/zz_generated.featuregated-crd-manifests/machines.machine.openshift.io/MachineAPIMigration.yaml +++ b/machine/v1beta1/zz_generated.featuregated-crd-manifests/machines.machine.openshift.io/MachineAPIMigration.yaml @@ -569,6 +569,16 @@ spec: serialized/deserialized from this field. type: object x-kubernetes-preserve-unknown-fields: true + synchronizedAPI: + description: |- + synchronizedAPI holds the last stable value of authoritativeAPI. + It is used to detect migration cancellation requests and to restore the resource to its previous state. + Valid values are "MachineAPI" and "ClusterAPI". + When omitted, the resource has not yet been reconciled by the migration controller. + enum: + - MachineAPI + - ClusterAPI + type: string synchronizedGeneration: description: |- synchronizedGeneration is the generation of the authoritative resource that the non-authoritative resource is synchronised with. diff --git a/machine/v1beta1/zz_generated.featuregated-crd-manifests/machinesets.machine.openshift.io/MachineAPIMigration.yaml b/machine/v1beta1/zz_generated.featuregated-crd-manifests/machinesets.machine.openshift.io/MachineAPIMigration.yaml index 27f5decae69..8e2a0fef0ca 100644 --- a/machine/v1beta1/zz_generated.featuregated-crd-manifests/machinesets.machine.openshift.io/MachineAPIMigration.yaml +++ b/machine/v1beta1/zz_generated.featuregated-crd-manifests/machinesets.machine.openshift.io/MachineAPIMigration.yaml @@ -676,6 +676,16 @@ spec: description: replicas is the most recently observed number of replicas. format: int32 type: integer + synchronizedAPI: + description: |- + synchronizedAPI holds the last stable value of authoritativeAPI. + It is used to detect migration cancellation requests and to restore the resource to its previous state. + Valid values are "MachineAPI" and "ClusterAPI". + When omitted, the resource has not yet been reconciled by the migration controller. + enum: + - MachineAPI + - ClusterAPI + type: string synchronizedGeneration: description: |- synchronizedGeneration is the generation of the authoritative resource that the non-authoritative resource is synchronised with. diff --git a/machine/v1beta1/zz_generated.swagger_doc_generated.go b/machine/v1beta1/zz_generated.swagger_doc_generated.go index 093a4007694..0d043ad603d 100644 --- a/machine/v1beta1/zz_generated.swagger_doc_generated.go +++ b/machine/v1beta1/zz_generated.swagger_doc_generated.go @@ -626,6 +626,7 @@ var map_MachineStatus = map[string]string{ "phase": "phase represents the current phase of machine actuation. One of: Failed, Provisioning, Provisioned, Running, Deleting", "conditions": "conditions defines the current state of the Machine", "authoritativeAPI": "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.", + "synchronizedAPI": "synchronizedAPI holds the last stable value of authoritativeAPI. It is used to detect migration cancellation requests and to restore the resource to its previous state. Valid values are \"MachineAPI\" and \"ClusterAPI\". When omitted, the resource has not yet been reconciled by the migration controller.", "synchronizedGeneration": "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.", } @@ -729,6 +730,7 @@ var map_MachineSetStatus = map[string]string{ "errorReason": "In the event that there is a terminal problem reconciling the replicas, both ErrorReason and ErrorMessage will be set. ErrorReason will be populated with a succinct value suitable for machine interpretation, while ErrorMessage will contain a more verbose string suitable for logging and human consumption.\n\nThese fields should not be set for transitive errors that a controller faces that are expected to be fixed automatically over time (like service outages), but instead indicate that something is fundamentally wrong with the MachineTemplate's spec or the configuration of the machine controller, and that manual intervention is required. Examples of terminal errors would be invalid combinations of settings in the spec, values that are unsupported by the machine controller, or the responsible machine controller itself being critically misconfigured.\n\nAny transient errors that occur during the reconciliation of Machines can be added as events to the MachineSet object and/or logged in the controller's output.", "conditions": "conditions defines the current state of the MachineSet", "authoritativeAPI": "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.", + "synchronizedAPI": "synchronizedAPI holds the last stable value of authoritativeAPI. It is used to detect migration cancellation requests and to restore the resource to its previous state. Valid values are \"MachineAPI\" and \"ClusterAPI\". When omitted, the resource has not yet been reconciled by the migration controller.", "synchronizedGeneration": "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.", } diff --git a/openapi/generated_openapi/zz_generated.openapi.go b/openapi/generated_openapi/zz_generated.openapi.go index 657afb352d4..5ee47b9079b 100644 --- a/openapi/generated_openapi/zz_generated.openapi.go +++ b/openapi/generated_openapi/zz_generated.openapi.go @@ -42811,6 +42811,13 @@ func schema_openshift_api_machine_v1beta1_MachineSetStatus(ref common.ReferenceC Format: "", }, }, + "synchronizedAPI": { + SchemaProps: spec.SchemaProps{ + Description: "synchronizedAPI holds the last stable value of authoritativeAPI. It is used to detect migration cancellation requests and to restore the resource to its previous state. Valid values are \"MachineAPI\" and \"ClusterAPI\". When omitted, the resource has not yet been reconciled by the migration controller.", + Type: []string{"string"}, + Format: "", + }, + }, "synchronizedGeneration": { SchemaProps: spec.SchemaProps{ 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.", @@ -42996,6 +43003,13 @@ func schema_openshift_api_machine_v1beta1_MachineStatus(ref common.ReferenceCall Format: "", }, }, + "synchronizedAPI": { + SchemaProps: spec.SchemaProps{ + Description: "synchronizedAPI holds the last stable value of authoritativeAPI. It is used to detect migration cancellation requests and to restore the resource to its previous state. Valid values are \"MachineAPI\" and \"ClusterAPI\". When omitted, the resource has not yet been reconciled by the migration controller.", + Type: []string{"string"}, + Format: "", + }, + }, "synchronizedGeneration": { SchemaProps: spec.SchemaProps{ 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.",