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
OCPCLOUD-2563: Add Machine/MachineSet API for MAPI to CAPI migration #1818
base: master
Are you sure you want to change the base?
Conversation
@JoelSpeed: This pull request references OCPCLOUD-2563 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.16.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
Hello @JoelSpeed! Some important instructions when contributing to openshift/api: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were in the base set of test files, but other platforms have their own test file, so, pulled these out
/hold until @deads2k can review |
/retest |
LGTM at first pass. The Machine API Test files changes are unrelated to this change, right? Just a result of the new way that featuregates are being done? |
When adding feature gated fields, the generators now generate various feature gate versions of each CRD. Each CRD is required to have a test suite file, so I had to add them as I'm the first one putting a feature gated field on some of these resources |
I take it you're omitting MachineHealthCheck and ControlPlaneMachineSet here on purpose? |
Yes, my intention is that we build out the Machine and MachineSet core functionality for this feature first, and then once we have made progress on those, start looking more at the extensions like MHC and CPMS |
91c98da
to
8a8ed13
Compare
/test integration Change was a global timeout hit, not related to this PR |
8a8ed13
to
9190864
Compare
9190864
to
8a8ed13
Compare
I attempted to rebase this, then got confused as we are part way through changing how tests work (feature gates, files moving around). I don't think this is a blocker yet on our work so I have reverted to how Joel left it. New docs in https://github.com/openshift/api/pull/1834/files |
8a8ed13
to
51c2e94
Compare
🤞 for getting this rebase right, this time |
That's a fun bug in the bot 😂 All CI failing : CI Bot: all tests passed! |
machine/v1beta1/tests/machines.machine.openshift.io/MachineAPIMigration.yaml
Show resolved
Hide resolved
a8cc853
to
dc35ac5
Compare
@deads2k Additional transitional validations added and tests for enum and transitions as well |
dc35ac5
to
2dd9d27
Compare
2dd9d27
to
c807617
Compare
machine/v1beta1/types_machine.go
Outdated
@@ -287,6 +315,7 @@ type LifecycleHook struct { | |||
} | |||
|
|||
// MachineStatus defines the observed state of Machine | |||
// +openshift:validation:FeatureGateAwareXValidation:featureGate=MachineAPIMigration,rule="!has(oldSelf.synchronizedGeneration) || (has(self.synchronizedGeneration) && self.synchronizedGeneration >= oldSelf.synchronizedGeneration) || (oldSelf.authoritativeAPI == 'Migrating' && self.authoritativeAPI != 'Migrating')",message="syncronizedGeneration must not decrease unless authoritativeAPI is transitioning from Migrating to another value" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll trust that there's a test for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are 8 for Machine and 8 for MachineSet specifically testing this rule
@@ -459,4 +459,10 @@ var ( | |||
productScope(ocpSpecific). | |||
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). | |||
mustRegister() | |||
|
|||
FeatureGateMachineAPIMigration = newFeatureGate("MachineAPIMigration"). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
intentionally never enabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. As this is greenfield, there's a lot to build before we have something that works. My hope was that we can get this all set up to a point where there's actually something tangible before adding to a feature set some time in 4.17
/lgtm |
c807617
to
cc9f337
Compare
Small update to fix a typo, and then added a I've also got a PR up for the generator to add the |
cc9f337
to
44d5634
Compare
44d5634
to
d3739e0
Compare
Tests and validations look good to me! /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, JoelSpeed, theobarberbany The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@JoelSpeed: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
This implements the first part of the API from openshift/enhancements#1465.
This adds a new
authoritativeAPI
field to the Machine and MachineSet spec and status, which will allow our new project to determine which of the two backends should be implementing the functionality of the machines.The feature will be behing the MachineAPIMigration feature gate. Not adding this to TechPreview until we have got something to show for the project, likely in 4.17.