api icon indicating copy to clipboard operation
api copied to clipboard

OCPCLOUD-2563: Add Machine/MachineSet API for MAPI to CAPI migration

Open JoelSpeed opened this issue 1 year ago • 19 comments

This implements the first part of the API from https://github.com/openshift/enhancements/pull/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.

JoelSpeed avatar Mar 19 '24 15:03 JoelSpeed

@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 https://github.com/openshift/enhancements/pull/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.

openshift-ci-robot avatar Mar 19 '24 15:03 openshift-ci-robot

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[bot] avatar Mar 19 '24 15:03 openshift-ci[bot]

/hold until @deads2k can review

JoelSpeed avatar Mar 19 '24 15:03 JoelSpeed

/retest

theobarberbany avatar Mar 20 '24 12:03 theobarberbany

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?

theobarberbany avatar Mar 20 '24 12:03 theobarberbany

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

JoelSpeed avatar Mar 20 '24 15:03 JoelSpeed

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

nrb avatar Mar 20 '24 18:03 nrb

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 avatar Mar 21 '24 13:03 JoelSpeed

/test integration

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

JoelSpeed avatar Mar 22 '24 12:03 JoelSpeed

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

theobarberbany avatar Apr 02 '24 09:04 theobarberbany

🤞 for getting this rebase right, this time

theobarberbany avatar Apr 10 '24 17:04 theobarberbany

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!

theobarberbany avatar Apr 10 '24 20:04 theobarberbany

/retest

theobarberbany avatar Apr 11 '24 09:04 theobarberbany

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

JoelSpeed avatar Apr 22 '24 14:04 JoelSpeed

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

deads2k avatar Apr 23 '24 19:04 deads2k

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

JoelSpeed avatar Apr 24 '24 09:04 JoelSpeed

Tests and validations look good to me!

/lgtm

theobarberbany avatar Apr 24 '24 14:04 theobarberbany

/hold cancel

4.17 is now open so we can merge this

JoelSpeed avatar May 20 '24 11:05 JoelSpeed

/lgtm

racheljpg avatar May 20 '24 11:05 racheljpg

Had to update various list type tags since a few were missing in the machine APIs, should be good to go now

JoelSpeed avatar May 21 '24 10:05 JoelSpeed

/override ci/prow/verify-crd-schema

All pre-existing failures that cannot be resolved. Final commit here resolves those that could be fixed

JoelSpeed avatar May 21 '24 11:05 JoelSpeed

@JoelSpeed: Overrode contexts on behalf of JoelSpeed: ci/prow/verify-crd-schema

In response to this:

/override ci/prow/verify-crd-schema

All pre-existing failures that cannot be resolved. Final commit here resolves those that could be fixed

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-sigs/prow repository.

openshift-ci[bot] avatar May 21 '24 11:05 openshift-ci[bot]

/lgtm

theobarberbany avatar May 21 '24 16:05 theobarberbany

/retest-required

JoelSpeed avatar May 21 '24 16:05 JoelSpeed

/test verify-client-go

soltysh avatar May 22 '24 13:05 soltysh

/test verify-client-go

JoelSpeed avatar May 22 '24 15:05 JoelSpeed

/retest

JoelSpeed avatar May 23 '24 12:05 JoelSpeed

/override ci/prow/verify-crd-schema

JoelSpeed avatar May 23 '24 16:05 JoelSpeed

@JoelSpeed: Overrode contexts on behalf of JoelSpeed: ci/prow/verify-crd-schema

In response to this:

/override ci/prow/verify-crd-schema

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-sigs/prow repository.

openshift-ci[bot] avatar May 23 '24 16:05 openshift-ci[bot]

/lgtm

racheljpg avatar May 23 '24 16:05 racheljpg