Skip to content

MCO-2296: Promote OSImageStreams to v1#2854

Open
pablintino wants to merge 1 commit into
openshift:masterfrom
pablintino:osimagestream-v1
Open

MCO-2296: Promote OSImageStreams to v1#2854
pablintino wants to merge 1 commit into
openshift:masterfrom
pablintino:osimagestream-v1

Conversation

@pablintino
Copy link
Copy Markdown
Contributor

This change moves OSImageStreams from v1alpha to v1 apiVersion as part of the GA process of the API.

@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 openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 21, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 21, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 21, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 21, 2026

Hello @pablintino! 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-robot
Copy link
Copy Markdown

openshift-ci-robot commented May 21, 2026

@pablintino: This pull request references MCO-2296 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.0.0" version, but no target version was set.

Details

In response to this:

This change moves OSImageStreams from v1alpha to v1 apiVersion as part of the GA process of the API.

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.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

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: 36bf5407-62a3-46e8-9fe9-58283d89ca24

📥 Commits

Reviewing files that changed from the base of the PR and between 15eb0fc and d966b3d.

⛔ Files ignored due to path filters (5)
  • machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_osimagestreams.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • machineconfiguration/v1/zz_generated.deepcopy.go is excluded by !**/zz_generated*
  • machineconfiguration/v1/zz_generated.featuregated-crd-manifests.yaml is excluded by !**/zz_generated*
  • machineconfiguration/v1/zz_generated.featuregated-crd-manifests/osimagestreams.machineconfiguration.openshift.io/OSStreams.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • machineconfiguration/v1/zz_generated.swagger_doc_generated.go is excluded by !**/zz_generated*
📒 Files selected for processing (5)
  • hack/update-payload-crds.sh
  • machineconfiguration/v1/register.go
  • machineconfiguration/v1/tests/osimagestreams.machineconfiguration.openshift.io/OSStreams.yaml
  • machineconfiguration/v1/types_osimagestream.go
  • payload-manifests/crds/0000_80_machine-config_01_osimagestreams.crd.yaml
💤 Files with no reviewable changes (1)
  • hack/update-payload-crds.sh

📝 Walkthrough

Walkthrough

This PR promotes the OSImageStream API from unstable v1alpha1 to stable v1. The Go type definitions move to the v1 package with updated OpenShift compatibility metadata changing from level 4 (no guarantees) to level 1 (stable within a major release). The v1 types are registered to the scheme, the CRD manifest is updated to expose v1, all test manifests are changed to use the v1 apiVersion consistently, and the build script is cleaned up to remove the osimagestreams CRD glob pattern.

🚥 Pre-merge checks | ✅ 12
✅ Passed checks (12 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: promoting OSImageStreams API from v1alpha to v1 as part of GA.
Description check ✅ Passed The description directly relates to the changeset, explaining the purpose of moving OSImageStreams from v1alpha to v1 for GA.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 This PR does not contain Ginkgo tests. The only test-like content is a CRD validation schema test file (OSStreams.yaml) with 26 stable, descriptive test names containing no dynamic data.
Test Structure And Quality ✅ Passed Tests are declarative YAML manifests for CRD validation, not Go/Ginkgo. 26 test cases follow repo patterns with clear descriptions, single responsibilities, and explicit assertions.
Microshift Test Compatibility ✅ Passed PR contains no Ginkgo e2e tests—only API promotion code and CRD validation manifests, which fall outside the scope of this check.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No Ginkgo e2e tests added in this PR. OSStreams.yaml is a CRD schema validation test manifest, not a Ginkgo e2e test, and makes no multi-node cluster assumptions.
Topology-Aware Scheduling Compatibility ✅ Passed PR contains only API type definitions, CRD schema, and test manifests—no deployment manifests, workloads, or scheduling constraints that would affect different OpenShift topologies.
Ote Binary Stdout Contract ✅ Passed PR modifies type definitions and test manifests only; no code writes to stdout in process-level contexts (main, init, BeforeSuite, etc.) or violates OTE binary contract.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR adds no Ginkgo e2e tests. Changes are Go type definitions, CRD manifests, and declarative test data only.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

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 openshift-ci Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 21, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 21, 2026

[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 deads2k 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

@JoelSpeed
Copy link
Copy Markdown
Contributor

@pablintino Rather than moving the files, I need you to create fresh copies of it all. We need a copy in both the v1 and v1alpha1 locations at the same time to merge, and then we can remove the v1alpha1 copies later.

Otherwise it will cause issues for those trying to update code already built against v1alpha1

@openshift-ci openshift-ci Bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 21, 2026
@pablintino pablintino marked this pull request as ready for review May 21, 2026 14:15
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 21, 2026
@openshift-ci openshift-ci Bot requested review from JoelSpeed and cheesesashimi May 21, 2026 14:16
@pablintino
Copy link
Copy Markdown
Contributor Author

@pablintino Rather than moving the files, I need you to create fresh copies of it all. We need a copy in both the v1 and v1alpha1 locations at the same time to merge, and then we can remove the v1alpha1 copies later.

Otherwise it will cause issues for those trying to update code already built against v1alpha1

Thanks for the explanation @JoelSpeed, appreciated.
I've restored the v1alpha content. Beware that I preserved the removal of the v1alpha CRDs

Copy link
Copy Markdown

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

🧹 Nitpick comments (1)
payload-manifests/crds/0000_80_machine-config_01_osimagestreams.crd.yaml (1)

9-9: 💤 Low value

Consider whether TechPreviewNoUpgrade is appropriate for a v1 API.

The CRD is marked with release.openshift.io/feature-set: CustomNoUpgrade,DevPreviewNoUpgrade,TechPreviewNoUpgrade, which restricts it to tech preview and custom feature sets. Typically, v1 APIs are considered GA (generally available) and should be in the Default feature set. This might be intentional if you're promoting the API structure to v1 while keeping the feature gated until full GA readiness, but worth confirming this is the intended approach.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@payload-manifests/crds/0000_80_machine-config_01_osimagestreams.crd.yaml` at
line 9, The CRD for osimagestreams is labeled with
release.openshift.io/feature-set:
CustomNoUpgrade,DevPreviewNoUpgrade,TechPreviewNoUpgrade which gates the v1 API
behind tech-preview; decide whether this v1 API should be GA and, if so, change
the feature-set to include the Default feature set (e.g., replace the value with
Default or remove TechPreviewNoUpgrade/DevPreviewNoUpgrade entries), otherwise
keep the current gating—update the release.openshift.io/feature-set annotation
accordingly on the osimagestreams CRD definition to reflect the intended release
maturity.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@machineconfiguration/v1/types_osimagestream.go`:
- Around line 30-33: The comment for the metav1.ObjectMeta field `metadata` is
missing the omission behavior; update the field doc in types_osimagestream.go to
state what happens when callers omit `metadata` (for example: which values are
defaulted/filled by the API server — e.g., name/namespace may be generated or
validated, labels/annotations are empty unless provided, and other optional
metadata fields remain unset) so that the `+optional` annotation for `metadata`
and the type metav1.ObjectMeta clearly document the server-side defaults and
caller expectations.

In `@payload-manifests/crds/0000_80_machine-config_01_osimagestreams.crd.yaml`:
- Around line 21-23: Re-add the removed v1alpha1 entry under spec.versions
alongside the new v1 entry so the CRD preserves the old API; ensure
spec.versions contains two items named "v1" and "v1alpha1", set v1 to served:
true and storage: true, set v1alpha1 to served: true and storage: false, and
copy the existing schema block from v1 into the v1alpha1 entry (or keep the
previous v1alpha1 schema) so consumers of the v1alpha1 API continue to work
during the transition.

---

Nitpick comments:
In `@payload-manifests/crds/0000_80_machine-config_01_osimagestreams.crd.yaml`:
- Line 9: The CRD for osimagestreams is labeled with
release.openshift.io/feature-set:
CustomNoUpgrade,DevPreviewNoUpgrade,TechPreviewNoUpgrade which gates the v1 API
behind tech-preview; decide whether this v1 API should be GA and, if so, change
the feature-set to include the Default feature set (e.g., replace the value with
Default or remove TechPreviewNoUpgrade/DevPreviewNoUpgrade entries), otherwise
keep the current gating—update the release.openshift.io/feature-set annotation
accordingly on the osimagestreams CRD definition to reflect the intended release
maturity.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 29ce1b49-0a21-4449-bad0-02efbfec0578

📥 Commits

Reviewing files that changed from the base of the PR and between 0159ec3 and fe3cc54.

⛔ Files ignored due to path filters (5)
  • machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_osimagestreams.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • machineconfiguration/v1/zz_generated.deepcopy.go is excluded by !**/zz_generated*
  • machineconfiguration/v1/zz_generated.featuregated-crd-manifests.yaml is excluded by !**/zz_generated*
  • machineconfiguration/v1/zz_generated.featuregated-crd-manifests/osimagestreams.machineconfiguration.openshift.io/OSStreams.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • machineconfiguration/v1/zz_generated.swagger_doc_generated.go is excluded by !**/zz_generated*
📒 Files selected for processing (5)
  • hack/update-payload-crds.sh
  • machineconfiguration/v1/register.go
  • machineconfiguration/v1/tests/osimagestreams.machineconfiguration.openshift.io/OSStreams.yaml
  • machineconfiguration/v1/types_osimagestream.go
  • payload-manifests/crds/0000_80_machine-config_01_osimagestreams.crd.yaml
💤 Files with no reviewable changes (1)
  • hack/update-payload-crds.sh

Comment on lines +30 to +33
// metadata is the standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
metav1.ObjectMeta `json:"metadata,omitempty"`
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Document the omission behavior for metadata.

Line 32 marks metadata as optional, but the comment does not say what happens when callers omit it. For a new v1 API, that omission behavior should be part of the field docs.

As per coding guidelines, "Documentation for +optional fields must explain the behavior when the field is omitted".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@machineconfiguration/v1/types_osimagestream.go` around lines 30 - 33, The
comment for the metav1.ObjectMeta field `metadata` is missing the omission
behavior; update the field doc in types_osimagestream.go to state what happens
when callers omit `metadata` (for example: which values are defaulted/filled by
the API server — e.g., name/namespace may be generated or validated,
labels/annotations are empty unless provided, and other optional metadata fields
remain unset) so that the `+optional` annotation for `metadata` and the type
metav1.ObjectMeta clearly document the server-side defaults and caller
expectations.

Comment on lines 21 to 23
versions:
- name: v1alpha1
- name: v1
schema:
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot May 21, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Breaking change: v1alpha1 version completely removed instead of preserved alongside v1.

The CRD now serves only v1, with no v1alpha1 entry in spec.versions. This breaks existing consumers using v1alpha1. Standard Kubernetes API versioning practice is to preserve the old version when promoting:

spec:
  versions:
  - name: v1
    served: true
    storage: true
    schema: ...
  - name: v1alpha1
    served: true
    storage: false
    schema: ...

Then deprecate and remove v1alpha1 in a later release after a transition period. This aligns with the reviewer's feedback to "maintain copies in v1alpha1 and add v1 copies now, then remove v1alpha1 later."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@payload-manifests/crds/0000_80_machine-config_01_osimagestreams.crd.yaml`
around lines 21 - 23, Re-add the removed v1alpha1 entry under spec.versions
alongside the new v1 entry so the CRD preserves the old API; ensure
spec.versions contains two items named "v1" and "v1alpha1", set v1 to served:
true and storage: true, set v1alpha1 to served: true and storage: false, and
copy the existing schema block from v1 into the v1alpha1 entry (or keep the
previous v1alpha1 schema) so consumers of the v1alpha1 API continue to work
during the transition.

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.

This should just be defining what gets shipped in the payload. The alpha API is still available but not directly used in clusters after this change. This shouldn't be a problem assuming we switch over all references (MCO, tests, etc.) altogether

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@yuqi-zhang, thanks for the clarification! That context makes sense — since this is the payload CRD definition and the intent is an atomic switchover of all consumers (MCO, tests, etc.) to v1 simultaneously, preserving v1alpha1 in the payload is unnecessary.

The critical dependency here is that the switchover is truly complete before this lands — any consumer still referencing v1alpha1 in the cluster would break. It may be worth ensuring the PR description or linked Jira explicitly tracks the full list of required reference updates (MCO, tests, and any other tooling) as a checklist to guard against partial switchover.

I'll go ahead and resolve my comment since the concern doesn't apply given this deployment model. Would you like me to do that?


✏️ Learnings added
Learnt from: yuqi-zhang
Repo: openshift/api PR: 2854
File: payload-manifests/crds/0000_80_machine-config_01_osimagestreams.crd.yaml:21-23
Timestamp: 2026-05-21T14:39:01.495Z
Learning: In OpenShift's `payload-manifests/crds/` directory, a CRD version entry can be fully replaced (e.g., v1alpha1 → v1) without keeping the old version alongside the new one, provided all consumers (MCO, tests, tooling) are switched over atomically in the same release. This differs from the standard Kubernetes multi-version deprecation path. The key condition is that no in-cluster consumers reference the removed version after the change lands.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


// spec contains the desired OSImageStream config configuration.
// +required
Spec *OSImageStreamSpec `json:"spec,omitempty"`
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.

You shouldn't need a pointer here 🤔

Suggested change
Spec *OSImageStreamSpec `json:"spec,omitempty"`
Spec OSImageStreamSpec `json:"spec,omitzero"`

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

True, is no longer needed. Fixed.

This change moves OSImageStreams from v1alpha to v1 apiVersion as part
of the GA process of the API.

Signed-off-by: Pablo Rodriguez Nava <git@amail.pablintino.eu>
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 21, 2026

@pablintino: 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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants