Skip to content

OCPCLOUD-2715: machine/v1beta1: Add Node drain fields - #3055

Open
rexagod wants to merge 1 commit into
openshift:masterfrom
rexagod:machine-api-drain-timeouts
Open

rexagod wants to merge 1 commit into
openshift:masterfrom
rexagod:machine-api-drain-timeouts

Conversation

@rexagod

@rexagod rexagod commented Sep 22, 2026

Copy link
Copy Markdown
Member

Adds the following fields that mirror their counterparts from CAPI 1:

  • nodeDrainTimeoutSeconds
  • nodeVolumeDetachTimeoutSeconds
  • nodeDeletionTimeoutSeconds

These will be ingested by the machine-api-operator, as well as used for conversions between the CAPI and MAPI representations in cluster-capi-operator.

Both operators will exhibit same usage behaviors in parity with upstream CAPI, however, for the last two fields, their nil cases are adhered to the existing MAO behavior for compatibility.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Sep 22, 2026
@openshift-ci-robot

openshift-ci-robot commented Sep 22, 2026 •

Copy link
Copy Markdown

@rexagod: This pull request references OCPCLOUD-2715 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 "5.1.0" version, but no target version was set.

Details

In response to this:

Adds the following fields that mirror their counterparts from CAPI 1:

  • nodeDrainTimeoutSeconds
  • nodeVolumeDetachTimeoutSeconds
  • nodeDeletionTimeoutSeconds

These will be ingested by the machine-api-operator, as well as used for conversions between the CAPI and MAPI representations in cluster-capi-operator.

Both operators will exhibit same usage behaviors in parity with upstream CAPI, however, for the last two fields, their nil cases are adhered to the existing MAO behavior for compatibility.

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

openshift-ci Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Hello @rexagod! 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/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Sep 22, 2026
@openshift-ci
openshift-ci Bot requested review from JoelSpeed and mandre September 22, 2026 14:28
@openshift-ci

openshift-ci Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign joelspeed for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details 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

@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 11a22b3f-3770-477c-a942-e36ef1e60fff

📥 Commits

Reviewing files that changed from the base of the PR and between 3a6e03c and 5256275.

⛔ Files ignored due to path filters (15)
  • machine/v1/zz_generated.crd-manifests/0000_10_control-plane-machine-set_01_controlplanemachinesets-CustomNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • machine/v1/zz_generated.crd-manifests/0000_10_control-plane-machine-set_01_controlplanemachinesets-DevPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • machine/v1/zz_generated.crd-manifests/0000_10_control-plane-machine-set_01_controlplanemachinesets-TechPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • machine/v1/zz_generated.featuregated-crd-manifests/controlplanemachinesets.machine.openshift.io/MachineAPIMigration.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machines-CustomNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machines-DevPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machines-TechPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machinesets-CustomNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machinesets-DevPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machinesets-TechPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • machine/v1beta1/zz_generated.deepcopy.go is excluded by !**/zz_generated*
  • machine/v1beta1/zz_generated.featuregated-crd-manifests/machines.machine.openshift.io/MachineAPIMigration.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • machine/v1beta1/zz_generated.featuregated-crd-manifests/machinesets.machine.openshift.io/MachineAPIMigration.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • machine/v1beta1/zz_generated.swagger_doc_generated.go is excluded by !**/zz_generated*
  • openapi/generated_openapi/zz_generated.openapi.go is excluded by !openapi/**, !**/zz_generated*
📒 Files selected for processing (4)
  • machine/v1beta1/types_machine.go
  • payload-manifests/crds/0000_10_control-plane-machine-set_01_controlplanemachinesets-CustomNoUpgrade.crd.yaml
  • payload-manifests/crds/0000_10_control-plane-machine-set_01_controlplanemachinesets-DevPreviewNoUpgrade.crd.yaml
  • payload-manifests/crds/0000_10_control-plane-machine-set_01_controlplanemachinesets-TechPreviewNoUpgrade.crd.yaml

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Walkthrough

Walkthrough

MachineSpec now defines optional non-negative timeout fields for node draining, volume detachment, and node deletion. The three ControlPlaneMachineSet CRD variants expose matching template fields. The descriptions specify zero and unset behavior for each operation.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 52562

This adds optional node lifecycle timeout settings while preserving unset-versus-zero behavior and aligned CRD validation; the change is ready to merge.

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the addition of node drain-related fields. It is concise and directly related to the three timeout fields added by the pull request.
Description check ✅ Passed The description accurately summarizes the three fields, their CAPI relationship, and their intended operator usage. It is directly related to the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed The PR changes API declarations and generated CRD/OpenAPI/deep-copy files only. The authoritative diff contains no test files, Ginkgo declarations, or added dynamic test-title construction. Therefore,…
Test Structure And Quality ✅ Passed PASS: The pull request changes API declarations and generated CRD/OpenAPI/deep-copy files only. The authoritative diff contains no Ginkgo test files, It/Describe/Context blocks, setup or cleanup code,…
Microshift Test Compatibility ✅ Passed The pull-request diff adds no Ginkgo tests or test files. It changes Machine API types, generated code, and CRD manifests only. Therefore, the MicroShift test compatibility check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The pull request adds Machine API fields and generated CRD/OpenAPI/deep-copy artifacts only. The authoritative diff contains no new Ginkgo e2e tests or other test files, so the SNO multi-node compatib…
Topology-Aware Scheduling Compatibility ✅ Passed The pull request changes the Machine API type and generated CRD/OpenAPI/deep-copy artifacts only. The added fields are node lifecycle timeout fields. The diff adds no deployments, controllers, pod spe…
Ote Binary Stdout Contract ✅ Passed The pull-request diff changes only Machine API fields, generated deepcopy/OpenAPI documentation, and CRD schemas. It adds no OTE binary, main/init, suite setup, logging, or stdout write. Therefore, it…
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests were added. The pull request changes API type declarations and generated CRD/OpenAPI/deep-copy artifacts only. The added lines contain no IPv4 assumptions or external connectiv…
No-Weak-Crypto ✅ Passed The PR adds three timeout fields to MachineSpec and corresponding generated schema, deepcopy, and OpenAPI data. The authoritative diff contains no MD5, SHA1, DES, 3DES, RC4, Blowfish, or ECB usage, …
Container-Privileges ✅ Passed The reviewed range adds MachineSpec timeout fields and generated CRD schema entries. All changed YAML files are CustomResourceDefinition objects, not container or Pod manifests. The added-line scan fo…
No-Sensitive-Data-In-Logs ✅ Passed The pull request adds API fields, deepcopy support, OpenAPI metadata, and CRD schema descriptions. The changed Go files contain no logging calls or logger imports. Scans of added lines found no passwo…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

// attempting to drain the node until it succeeds.
// When not set, the behaviour is the same as a value of 0. This preserves the default Machine API
// drain behaviour and matches Cluster API.
// +kubebuilder:validation:Minimum=0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a sensible maximum we could impose for any of these fields?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I looked at the controller logic to try to infer something but I don't think one exists, even from the perspective of OpenShift. This is also in-line with the fact that a zero-value for these will wait indefinitely (effectively going beyond whatever Maximum is set to).

Adds the following fields that mirror their counterparts from CAPI [1]:
* nodeDrainTimeoutSeconds
* nodeVolumeDetachTimeoutSeconds
* nodeDeletionTimeoutSeconds

These will be ingested by the machine-api-operator, as well as used for
conversions between the CAPI and MAPI representations in
cluster-capi-operator.

Both operators will exhibit same usage behaviors in parity with upstream
CAPI, however, for the last two fields, their nil cases are adhered to
the existing MAO behavior for compatibility.

[1]:https://github.com/kubernetes-sigs/cluster-api/blob/main/api/core/v1beta1/machine_types.go#L445-L460
@rexagod
rexagod force-pushed the machine-api-drain-timeouts branch from 5256275 to 4bdf0b9 Compare September 24, 2026 07:17
@rexagod

rexagod commented Sep 24, 2026

Copy link
Copy Markdown
Member Author

/retest

@rexagod

rexagod commented Sep 25, 2026

Copy link
Copy Markdown
Member Author

/test verify-feature-promotion

F0924 08:29:05.417162 10595 root.go:64] Error running codegen: couldn't determine release version: error fetching data from API: Get "https://sippy.dptools.openshift.org/api/releases": dial tcp: lookup sippy.dptools.openshift.org on 172.30.0.10:53: read udp 10.130.0.105:60785->172.30.0.10:53: i/o timeout

@openshift-ci

openshift-ci Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

@rexagod: all tests passed!

Full PR test history. Your PR dashboard.

Details

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. 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

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants