Skip to content

CORS-4495: Populate RHCOS10 Marketplace Stream#10556

Open
patrickdillon wants to merge 1 commit into
openshift:mainfrom
patrickdillon:pop-rhcos10-az-mkt
Open

CORS-4495: Populate RHCOS10 Marketplace Stream#10556
patrickdillon wants to merge 1 commit into
openshift:mainfrom
patrickdillon:pop-rhcos10-az-mkt

Conversation

@patrickdillon
Copy link
Copy Markdown
Contributor

@patrickdillon patrickdillon commented May 14, 2026

Updates the script to populate azure marketplace images to include the rhel10 stream. If RHCOS10 images are not present, we can fall back to RHCOS9, as the first-boot image will be updated to RHCOS10.

Summary by CodeRabbit

  • New Features

    • Added CoreOS RHEL 10 marketplace configurations for multiple architectures, regions, and Azure image variants.
  • Updates

    • Bumped CoreOS RHEL 9 marketplace metadata with updated SKUs and version strings across supported offers and regions.
  • Chores

    • Marketplace generation tool now produces streams for RHEL 9 and RHEL 10, with configurable inputs/outputs and fallback handling when RHEL 10 data is missing.

@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 14, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented May 14, 2026

@patrickdillon: This pull request references CORS-4495 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:

Updates the script to populate azure marketplace images to include the rhel10 stream. If RHCOS10 images are not present, we can fall back to RHCOS9, as the first-boot image will be updated to RHCOS10.

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 14, 2026

Walkthrough

The PR extends the marketplace stream population script to support dual RHEL 9 and RHEL 10 generation with fallback logic, and updates marketplace metadata. The script now accepts configuration to parameterize input and output paths per stream, orchestrates sequential RHEL 9 and RHEL 10 population, and falls back to RHEL 9 data when Azure marketplace content is missing or population fails.

Changes

Marketplace Dual-Stream Generation

Layer / File(s) Summary
Dual-stream orchestration and I/O
hack/rhcos/populate-marketplace-imagestream.go
streamConfig struct parameterizes per-stream input/output paths and naming. main builds RHEL 9 stream, writes to configured output, then builds RHEL 10 with fallback. write uses config-driven outputFile instead of fixed paths.
Marketplace population from Azure with fallback
hack/rhcos/populate-marketplace-imagestream.go
populate accepts streamConfig to build per-architecture entries. Azure population (azure method) reads from config input file and derives release versions. populateWithFallback and isAzureMarketplaceEmpty detect and recover from missing Azure marketplace via nil checks. getReleaseFromStream extracts versions from configured inputs.
RHEL 10 marketplace metadata
data/data/coreos/marketplace/coreos-rhel-10.json
New lookup table keyed by architecture (aarch64, x86_64), Azure product channels (ocp, opp, oke, regional EMEA variants), and HyperV generation, mapping to Azure Marketplace publisher, offer, sku, and version identifiers.
RHEL 9 marketplace data updates
data/data/coreos/marketplace/coreos-rhel-9.json
Updated aarch64 no-purchase-plan with new sku 421-arm and version 9.6.20251212. Updated x86_64 no-purchase-plan with new ARO and v2 SKU identifiers and matching versions. Updated all x86_64 ocp/opp/oke channels (standard and EMEA) with new release versions 9.6.2026030314 (non-EMEA) and 4.18.2026012111 (EMEA).

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'CORS-4495: Populate RHCOS10 Marketplace Stream' clearly and concisely summarizes the main change: adding RHEL10/RHCOS10 marketplace stream population with fallback logic.
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.

✏️ 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: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

@openshift-ci openshift-ci Bot requested review from Roshan-R and bfournie May 14, 2026 20:05
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 14, 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 sdodson 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

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
hack/rhcos/populate-marketplace-imagestream.go (1)

152-167: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Guard release parsing to avoid panic on malformed stream names.

strings.Split(st.Stream, "-")[1] can panic if st.Stream is empty or missing -. Return a structured error instead.

Proposed fix
 func getReleaseFromStream(cfg streamConfig) (string, error) {
@@
-	return strings.Split(st.Stream, "-")[1], nil
+	parts := strings.SplitN(st.Stream, "-", 2)
+	if len(parts) < 2 || strings.TrimSpace(parts[1]) == "" {
+		return "", fmt.Errorf("unexpected stream format %q in %s", st.Stream, cfg.inputFile)
+	}
+	return parts[1], nil
 }
🤖 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 `@hack/rhcos/populate-marketplace-imagestream.go` around lines 152 - 167, The
getReleaseFromStream function assumes st.Stream contains a hyphen and indexes
strings.Split(st.Stream, "-")[1], which can panic for empty or malformed values;
update the function to validate st.Stream (and the result of strings.Split)
before indexing: if STREAM_RELEASE_OVERRIDE is not set, ensure st.Stream is
non-empty, split into parts (or find the first '-') and check there is at least
two parts (or a valid index) and return a clear error (e.g., fmt.Errorf("invalid
stream format: %q", st.Stream)) instead of panicking; keep the existing
STREAM_RELEASE_OVERRIDE behavior and use the same error wrapping pattern used
elsewhere in the function.
🤖 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 `@hack/rhcos/populate-marketplace-imagestream.go`:
- Around line 90-94: The code currently falls back to RHEL9 on any error from
s.azure; change the error handling in the block calling s.azure(ctx,
supportedArch, cfg) so it only falls back when the error represents the expected
“RHEL10 marketplace unavailable/missing” case (use a specific sentinel error,
errors.Is, or a string match like strings.Contains(err.Error(), "marketplace
missing" / the exact provider message) to detect that case); if that specific
condition is true, perform the existing log.Printf and s[supportedArch] =
fallback[supportedArch] and continue, otherwise return or propagate the original
err instead of falling back (so non-marketplace errors are surfaced).

---

Outside diff comments:
In `@hack/rhcos/populate-marketplace-imagestream.go`:
- Around line 152-167: The getReleaseFromStream function assumes st.Stream
contains a hyphen and indexes strings.Split(st.Stream, "-")[1], which can panic
for empty or malformed values; update the function to validate st.Stream (and
the result of strings.Split) before indexing: if STREAM_RELEASE_OVERRIDE is not
set, ensure st.Stream is non-empty, split into parts (or find the first '-') and
check there is at least two parts (or a valid index) and return a clear error
(e.g., fmt.Errorf("invalid stream format: %q", st.Stream)) instead of panicking;
keep the existing STREAM_RELEASE_OVERRIDE behavior and use the same error
wrapping pattern used elsewhere in the function.
🪄 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: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: db61ce43-37ee-437f-928a-c8ddad4f7fa4

📥 Commits

Reviewing files that changed from the base of the PR and between 1fc515d and bef823d.

📒 Files selected for processing (3)
  • data/data/coreos/marketplace/coreos-rhel-10.json
  • data/data/coreos/marketplace/coreos-rhel-9.json
  • hack/rhcos/populate-marketplace-imagestream.go

Comment thread hack/rhcos/populate-marketplace-imagestream.go
Updates the script to populate azure marketplace images to include
the rhel10 stream. If RHCOS10 images are not present, we can
fall back to RHCOS9, as the first-boot image will be updated to
RHCOS10.
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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
hack/rhcos/populate-marketplace-imagestream.go (1)

165-165: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Guard release parsing to avoid panic on malformed stream names.

Line 165 indexes into strings.Split(...)[1] without validating shape. If st.Stream is malformed, this panics and aborts the script.

Proposed fix
-	return strings.Split(st.Stream, "-")[1], nil
+	parts := strings.SplitN(st.Stream, "-", 2)
+	if len(parts) != 2 || parts[1] == "" {
+		return "", fmt.Errorf("invalid stream format %q, expected <name>-<release>", st.Stream)
+	}
+	return parts[1], nil
🤖 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 `@hack/rhcos/populate-marketplace-imagestream.go` at line 165, The code blindly
returns strings.Split(st.Stream, "-")[1] which can panic if st.Stream doesn't
contain a '-' or has fewer than two parts; update the parsing around
strings.Split(st.Stream, "-") to check the resulting slice length (e.g., parts
:= strings.Split(st.Stream, "-"); if len(parts) < 2 { return "",
fmt.Errorf("malformed stream: %q", st.Stream) }) and then return parts[1], nil,
ensuring the function (the one using st.Stream) returns an error on malformed
input instead of panicking.
🤖 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 `@hack/rhcos/populate-marketplace-imagestream.go`:
- Around line 84-86: Update the doc comment for the function
populateWithFallback to reflect the current behavior: remove the claim that a
fallback occurs when population "fails" and state that the function falls back
only when marketplace data is empty; ensure the comment mentions that errors
(e.g., Azure errors) are still returned immediately rather than triggering the
fallback.

---

Outside diff comments:
In `@hack/rhcos/populate-marketplace-imagestream.go`:
- Line 165: The code blindly returns strings.Split(st.Stream, "-")[1] which can
panic if st.Stream doesn't contain a '-' or has fewer than two parts; update the
parsing around strings.Split(st.Stream, "-") to check the resulting slice length
(e.g., parts := strings.Split(st.Stream, "-"); if len(parts) < 2 { return "",
fmt.Errorf("malformed stream: %q", st.Stream) }) and then return parts[1], nil,
ensuring the function (the one using st.Stream) returns an error on malformed
input instead of panicking.
🪄 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: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 1e556c67-c83f-4a9e-9bce-f04aeabec6ab

📥 Commits

Reviewing files that changed from the base of the PR and between bef823d and 15331f6.

📒 Files selected for processing (3)
  • data/data/coreos/marketplace/coreos-rhel-10.json
  • data/data/coreos/marketplace/coreos-rhel-9.json
  • hack/rhcos/populate-marketplace-imagestream.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • data/data/coreos/marketplace/coreos-rhel-10.json
  • data/data/coreos/marketplace/coreos-rhel-9.json

Comment on lines +84 to +86
// populateWithFallback attempts to populate marketplace data for each architecture.
// If population fails or returns empty data, it falls back to the provided fallback stream.
func (s marketplaceStream) populateWithFallback(ctx context.Context, cfg streamConfig, fallback marketplaceStream) error {
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

Fallback comment is out of date with current behavior.

Line 85 says fallback happens when population fails, but Lines 90-92 return the Azure error immediately. Please update the comment to “fallback on empty marketplace data” only.

🤖 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 `@hack/rhcos/populate-marketplace-imagestream.go` around lines 84 - 86, Update
the doc comment for the function populateWithFallback to reflect the current
behavior: remove the claim that a fallback occurs when population "fails" and
state that the function falls back only when marketplace data is empty; ensure
the comment mentions that errors (e.g., Azure errors) are still returned
immediately rather than triggering the fallback.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 15, 2026

@patrickdillon: 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 15331f6 link true /test e2e-aws-ovn

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants