Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

JoelSpeed
Copy link
Contributor

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.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 19, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 19, 2024

@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:

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.

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.

Copy link
Contributor

openshift-ci bot commented Mar 19, 2024

Hello @JoelSpeed! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

@openshift-ci openshift-ci bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Mar 19, 2024
Copy link
Contributor Author

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 19, 2024
@JoelSpeed
Copy link
Contributor Author

/hold until @deads2k can review

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 19, 2024
@theobarberbany
Copy link
Contributor

/retest

@theobarberbany
Copy link
Contributor

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?

@JoelSpeed
Copy link
Contributor Author

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

@nrb
Copy link

nrb commented Mar 20, 2024

I take it you're omitting MachineHealthCheck and ControlPlaneMachineSet here on purpose?

@JoelSpeed
Copy link
Contributor Author

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

@JoelSpeed JoelSpeed force-pushed the mapi-authoritative-api branch 2 times, most recently from 91c98da to 8a8ed13 Compare March 21, 2024 17:29
@JoelSpeed
Copy link
Contributor Author

/test integration

Change was a global timeout hit, not related to this PR

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 23, 2024
@openshift-merge-robot openshift-merge-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Mar 27, 2024
@theobarberbany
Copy link
Contributor

theobarberbany commented Apr 2, 2024

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

@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 10, 2024
@theobarberbany
Copy link
Contributor

🤞 for getting this rebase right, this time

@openshift-ci openshift-ci bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Apr 10, 2024
@theobarberbany
Copy link
Contributor

theobarberbany commented Apr 10, 2024

That's a fun bug in the bot 😂

All CI failing : Terminal error: nonretryable error: no build client found for cluster "build03".

CI Bot: all tests passed!

@JoelSpeed
Copy link
Contributor Author

@deads2k Additional transitional validations added and tests for enum and transitions as well

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 23, 2024
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 23, 2024
@@ -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"
Copy link
Contributor

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.

Copy link
Contributor Author

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").
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

intentionally never enabled?

Copy link
Contributor Author

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

@deads2k
Copy link
Contributor

deads2k commented Apr 23, 2024

/lgtm
/hold for the team to make their judgement as well.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 23, 2024
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 24, 2024
@JoelSpeed
Copy link
Contributor Author

Small update to fix a typo, and then added a fieldPath and reason for the CEL preventing reduction of the synchronizedGeneration. Seems to me that it should be a Forbidden so I've updated that. Cosmetic change really.

I've also got a PR up for the generator to add the fieldPath and reason as a first class thing, so fingers crossed can drop the manual overrides in the future

@theobarberbany
Copy link
Contributor

Tests and validations look good to me!

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 24, 2024
Copy link
Contributor

openshift-ci bot commented Apr 24, 2024

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

openshift-ci bot commented Apr 24, 2024

@JoelSpeed: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-ovn-hypershift d3739e0 link true /test e2e-aws-ovn-hypershift

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants