Skip to content

ClusterAPI revision components can be empty#2728

Open
mdbooth wants to merge 1 commit intoopenshift:masterfrom
openshift-cloud-team:capio-empty-revision
Open

ClusterAPI revision components can be empty#2728
mdbooth wants to merge 1 commit intoopenshift:masterfrom
openshift-cloud-team:capio-empty-revision

Conversation

@mdbooth
Copy link
Contributor

@mdbooth mdbooth commented Feb 25, 2026

A revision with no components is actually a useful construct. It explicitly declares that the revision is not managing any components, or their manifests. The installer should not install anything, and should remove any components associated with an older revision.

@openshift-ci-robot
Copy link

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

@coderabbitai
Copy link

coderabbitai bot commented Feb 25, 2026

📝 Walkthrough

Walkthrough

The ClusterAPIInstallerRevision.Components field was changed from required to optional; its comment was expanded to state that omitting the field results in no components being installed and to retain the installation-order note. Generated API documentation and the CRD were updated to reflect optionality. Validation constraints for the field (MinItems=1 and MaxItems=32) remain present.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: making ClusterAPI revision components optional/empty, which is the central focus of all three modified files.
Description check ✅ Passed The description is directly related to the changeset, explaining the rationale for allowing empty components in a revision and how the installer should handle such revisions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.5.0)

Error: build linters: unable to load custom analyzer "kubeapilinter": tools/_output/bin/kube-api-linter.so, plugin: not implemented
The command is terminated due to an error: build linters: unable to load custom analyzer "kubeapilinter": tools/_output/bin/kube-api-linter.so, plugin: not implemented


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

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 25, 2026

Hello @mdbooth! 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/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Feb 25, 2026
// +required
// +optional
// +listType=atomic
// +kubebuilder:validation:MinItems=1
Copy link
Contributor

Choose a reason for hiding this comment

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

Please put this back. We don't want an unstructured client to be able to set components: [] since a structured client cannot do this, it would create something that doesn't round trip.

// revision. Components will be installed in the order they are listed.
// components is a list of components which will be installed by this
// revision. Components will be installed in the order they are listed. An
// empty or omitted list means no components will be installed.
Copy link
Contributor

Choose a reason for hiding this comment

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

Just omitted, not empty, we don't want to create a difference between omitted and empty and we don't want folks to write components: [] explicitly out

A revision with no components is actually a useful construct. It
explicitly declares that the revision is not managing any components, or
their manifests. The installer should not install anything, and should
remove any components associated with an older revision.
@mdbooth mdbooth force-pushed the capio-empty-revision branch from db8a25b to 74577dd Compare February 25, 2026 16:57
@JoelSpeed
Copy link
Contributor

/lgtm

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@operator/v1alpha1/zz_generated.swagger_doc_generated.go`:
- Line 174: Update the source comment for the Components field in
operator/v1alpha1/types_clusterapi.go to add the missing comma so the sentence
reads "If omitted, no components will be installed." (reference the Components
field / components description in that file), then re-run the swagger/doc
generator to regenerate operator/v1alpha1/zz_generated.swagger_doc_generated.go
so the corrected punctuation appears in the generated output.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between db8a25b and 74577dd.

⛔ Files ignored due to path filters (3)
  • openapi/generated_openapi/zz_generated.openapi.go is excluded by !openapi/**
  • operator/v1alpha1/zz_generated.crd-manifests/0000_30_cluster-api_01_clusterapis.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1alpha1/zz_generated.featuregated-crd-manifests/clusterapis.operator.openshift.io/ClusterAPIMachineManagement.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
📒 Files selected for processing (3)
  • operator/v1alpha1/types_clusterapi.go
  • operator/v1alpha1/zz_generated.swagger_doc_generated.go
  • payload-manifests/crds/0000_30_cluster-api_01_clusterapis.crd.yaml
🚧 Files skipped from review as they are similar to previous changes (2)
  • operator/v1alpha1/types_clusterapi.go
  • payload-manifests/crds/0000_30_cluster-api_01_clusterapis.crd.yaml

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 25, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JoelSpeed

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

The pull request process is described 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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 25, 2026
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 25, 2026
@openshift-ci-robot
Copy link

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aws-ovn
/test e2e-aws-ovn-hypershift
/test e2e-aws-ovn-hypershift-conformance
/test e2e-aws-ovn-techpreview
/test e2e-aws-serial-1of2
/test e2e-aws-serial-2of2
/test e2e-aws-serial-techpreview-1of2
/test e2e-aws-serial-techpreview-2of2
/test e2e-azure
/test e2e-gcp
/test e2e-upgrade
/test e2e-upgrade-out-of-change
/test minor-e2e-upgrade-minor

@qodo-code-review
Copy link

ⓘ Your monthly quota for Qodo has expired. Upgrade your plan
ⓘ Paying users. Check that your Qodo account is linked with this Git user account

@mdbooth
Copy link
Contributor Author

mdbooth commented Feb 26, 2026

/retest-required

@JoelSpeed
Copy link
Contributor

/retest

@mdbooth
Copy link
Contributor Author

mdbooth commented Feb 26, 2026

/test e2e-aws-serial-techpreview-1of2

@qodo-code-review
Copy link

ⓘ Your monthly quota for Qodo has expired. Upgrade your plan
ⓘ Paying users. Check that your Qodo account is linked with this Git user account

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 26, 2026

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

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants