Skip to content

CNTRLPLANE-3021: Multi-stream CoreOS boot image parsing in releaseinfo#8711

Closed
sdminonne wants to merge 4 commits into
openshift:mainfrom
sdminonne:CNTRLPLANE-3021
Closed

CNTRLPLANE-3021: Multi-stream CoreOS boot image parsing in releaseinfo#8711
sdminonne wants to merge 4 commits into
openshift:mainfrom
sdminonne:CNTRLPLANE-3021

Conversation

@sdminonne

@sdminonne sdminonne commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Extends the releaseinfo package to parse ConfigMaps containing the new streams key (a JSON map keyed by stream name like rhel-9, rhel-10) alongside the legacy stream key. This enables HyperShift to support dual-stream RHEL boot images from the OpenShift installer.

Builds on top of #8673 (CNTRLPLANE-3020: adopt coreos/stream-metadata-go upstream library).

Key additions:

  • DeserializeMultiStreamImageMetadata with StreamsResult for parsing multi-stream ConfigMaps
  • ReleaseImage extended with Streams / DefaultStream fields and a StreamForPool resolver method
  • Both provider implementations (registryclient_provider.go, registry_mirror_provider.go) updated to populate the new fields
  • New fixture 5.0-installer-coreos-bootimages.yaml for multi-stream testing
  • All existing callers using StreamMetadata continue working unchanged

Which issue(s) this PR fixes:

Fixes CNTRLPLANE-3021

Special notes for your reviewer:

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added multi-stream support for CoreOS release metadata with deterministic default selection.
  • Bug Fixes

    • Strengthened nil-safety and validation across AWS, Azure, GCP, OpenStack, PowerVS and KubeVirt image handling.
    • Improved error reporting when image/region/architecture metadata is missing or invalid.
    • Tighter defaulting and selection behavior for node pool images.
  • Chores

    • Migrated to the external stream-metadata model; updated tests, providers, and fixtures to match.

sdminonne and others added 3 commits June 10, 2026 09:56
Replace 18 custom CoreOS stream metadata Go types with canonical
equivalents from github.com/coreos/stream-metadata-go v0.4.11.
This eliminates duplicated type definitions and gains upstream
helper methods (e.g. GetAMI(), URN()), laying groundwork for the
dual-stream RHEL NodePool feature.

Key type mappings:
- CoreOSStreamMetadata -> stream.Stream
- CoreOSArchitecture -> stream.Arch
- CoreRHCOSImage -> *rhcos.Extensions (pointer)
- CoreOSAWSImages -> *stream.AwsImage (pointer)
- CoreOSGCPImage -> *stream.GcpImage (pointer)
- CoreOSPowerVSImage -> *stream.SingleObject
- CoreOSKubevirtImages -> *stream.ContainerImage (pointer)
- HyperVGen1/HyperVGen2 -> Gen1/Gen2
- SHA256 -> Sha256, URL -> Url (PowerVS)

Pure refactor with no behavioral changes. All platform controllers
updated with nil checks for pointer-typed upstream fields.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…eam types

Split the triple nil-check in getWindowsAMI into separate checks for
RHELCoreOSExtensions and AwsWinLi/Regions to produce distinct error
messages that make debugging easier.

Add test cases exercising nil pointer paths introduced by adopting
pointer-typed upstream stream-metadata-go fields:
- AWS: RHELCoreOSExtensions == nil, AwsWinLi == nil
- AWS nodepool controller: Aws images == nil
- KubeVirt: KubeVirt == nil
- PowerVS: PowerVS == nil (new test file)
- Azure: RHELCoreOSExtensions == nil

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extend the releaseinfo package to parse ConfigMaps containing the new
"streams" key (a JSON map keyed by stream name like "rhel-9", "rhel-10")
alongside the legacy "stream" key. This enables HyperShift to support
dual-stream RHEL boot images from the OpenShift installer.

Add DeserializeMultiStreamImageMetadata with StreamsResult, extend
ReleaseImage with Streams/DefaultStream fields and a StreamForPool
resolver, and update both provider implementations to populate the
new fields. All existing callers using StreamMetadata continue working
unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@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 Jun 10, 2026
@openshift-ci-robot

openshift-ci-robot commented Jun 10, 2026

Copy link
Copy Markdown

@sdminonne: This pull request references CNTRLPLANE-3021 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:

What this PR does / why we need it:

Extends the releaseinfo package to parse ConfigMaps containing the new streams key (a JSON map keyed by stream name like rhel-9, rhel-10) alongside the legacy stream key. This enables HyperShift to support dual-stream RHEL boot images from the OpenShift installer.

Builds on top of #8673 (CNTRLPLANE-3020: adopt coreos/stream-metadata-go upstream library).

Key additions:

  • DeserializeMultiStreamImageMetadata with StreamsResult for parsing multi-stream ConfigMaps
  • ReleaseImage extended with Streams / DefaultStream fields and a StreamForPool resolver method
  • Both provider implementations (registryclient_provider.go, registry_mirror_provider.go) updated to populate the new fields
  • New fixture 5.0-installer-coreos-bootimages.yaml for multi-stream testing
  • All existing callers using StreamMetadata continue working unchanged

Which issue(s) this PR fixes:

Fixes CNTRLPLANE-3021

Special notes for your reviewer:

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

🤖 Generated with Claude Code

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

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

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: 94191392-f5f4-4131-ae59-b71e100a6ab7

📥 Commits

Reviewing files that changed from the base of the PR and between 21b6898 and 6acb740.

📒 Files selected for processing (4)
  • hypershift-operator/controllers/nodepool/powervs_test.go
  • support/releaseinfo/deserialize.go
  • support/releaseinfo/deserialize_test.go
  • support/releaseinfo/releaseinfo_test.go
🚧 Files skipped from review as they are similar to previous changes (4)
  • hypershift-operator/controllers/nodepool/powervs_test.go
  • support/releaseinfo/deserialize_test.go
  • support/releaseinfo/deserialize.go
  • support/releaseinfo/releaseinfo_test.go

📝 Walkthrough

Walkthrough

This PR migrates HyperShift's release image metadata handling from an internal CoreOS schema to the external github.com/coreos/stream-metadata-go package. The migration includes removing internal type definitions, adding multi-stream ConfigMap parsing and a StreamsResult, updating ReleaseImage to expose per-name streams and StreamForPool selection, propagating stream maps through registry providers, and updating all platform controllers and tests to use the new stream types with added nil-safety and validation.

Sequence Diagram(s)

sequenceDiagram
  participant RegistryClient
  participant Deserialize as DeserializeMultiStreamImageMetadata
  participant ReleaseImage
  participant NodePoolController
  participant CloudProviders as {AWS,Azure,GCP,PowerVS,OpenStack,KubeVirt}
  RegistryClient->>Deserialize: fetch metadata ConfigMap
  Deserialize->>ReleaseImage: return Default stream + Streams map
  ReleaseImage->>NodePoolController: StreamMetadata or named stream via StreamForPool
  NodePoolController->>CloudProviders: lookup/construct provider images (AMI, Marketplace, GCP images, PowerVS object, OpenStack artifact, KubeVirt)
Loading

Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error)

Check name Status Explanation Resolution
No-Sensitive-Data-In-Logs ❌ Error New code logs raw YAML/JSON ConfigMap data containing URLs (potential internal hostnames) and image metadata in error paths at lines 53, 61, 70 of deserialize.go. Remove or redact raw data logging: replace string(data), streamData, and streamsData in error messages with generic descriptions or hashed values.
✅ Passed checks (10 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding multi-stream CoreOS boot image parsing support to the releaseinfo package, which is the primary objective of this PR.
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 All test names in modified test files use static, descriptive strings. New tests in deserialize_test.go and releaseinfo_test.go use hardcoded string literals in t.Run() calls; table-driven tests us...
Test Structure And Quality ✅ Passed The custom check requests review of Ginkgo test code, but this PR contains only standard Go unit tests (TestXxx functions with table-driven patterns). The check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR makes no scheduling-related changes. All modifications are to releaseinfo metadata parsing (new DeserializeMultiStreamImageMetadata function, Streams/DefaultStream fields) and controller image m...
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests added; PR updates only Go unit tests (*_test.go files) with metadata structure changes, none of which contain Ginkgo test framework patterns or external connectivity require...
No-Weak-Crypto ✅ Passed PR contains no MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB usage; no custom crypto implementations; and no non-constant-time secret comparisons. Changes are limited to metadata parsing and stream rout...
Container-Privileges ✅ Passed PR modifies only Go source files and adds a ConfigMap YAML fixture containing CoreOS metadata. No container specs or privileged K8s configurations are present or modified.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci openshift-ci Bot requested review from cblecker and clebs June 10, 2026 08:22
@openshift-ci

openshift-ci Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sdminonne
Once this PR has been reviewed and has the lgtm label, please assign sjenning 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

@openshift-ci openshift-ci Bot added area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release area/platform/aws PR/issue for AWS (AWSPlatform) platform area/platform/azure PR/issue for Azure (AzurePlatform) platform area/platform/gcp PR/issue for GCP (GCPPlatform) platform area/platform/kubevirt PR/issue for KubeVirt (KubevirtPlatform) platform area/platform/openstack PR/issue for OpenStack (OpenStackPlatform) platform area/platform/powervs PR/issue for PowerVS (PowerVSPlatform) platform and removed do-not-merge/needs-area labels Jun 10, 2026
@sdminonne sdminonne marked this pull request as draft June 10, 2026 08:22
@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 Jun 10, 2026

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 2

🧹 Nitpick comments (1)
hypershift-operator/controllers/nodepool/powervs_test.go (1)

13-54: ⚡ Quick win

Add one success-path case for getPowerVSImage.

Line 20 onward only validates failures; please add a valid metadata/region case that asserts returned image fields, so the migrated happy path is guarded too. As per coding guidelines, **/*_test.go: Unit test any code changes and additions, and include e2e tests when changes impact consumer behavior.

🤖 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 `@hypershift-operator/controllers/nodepool/powervs_test.go` around lines 13 -
54, Add a happy-path subtest to TestGetPowerVSImage that constructs a
releaseinfo.ReleaseImage whose StreamMetadata contains an entry for the
"ppc64le" architecture with Images.PowerVS including a "us-south" entry
(populate the image struct fields you expect), call getPowerVSImage("us-south",
releaseImage) and assert no error and that the returned image values
(ID/Name/other returned fields) match the expected values using the existing
NewWithT/Expect helpers; place this as an additional element in testCases and
mirror the existing test loop so the success case verifies returned image fields
rather than expecting an error.

Source: Coding guidelines

🤖 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 `@support/releaseinfo/deserialize.go`:
- Around line 74-99: The code currently allows an empty or nil-valued entry in
the streams map to slip through and later cause Default=nil or a panic when
accessing s.Stream; after unmarshalling, validate the streams map in the same
function that builds the StreamsResult: reject an entirely empty map (streams ==
nil or len(streams)==0) or return an error if any map value is nil, and when
calling matchDefaultStreamName ensure it checks nil entries before dereferencing
(update matchDefaultStreamName to skip nil values). Also ensure the branch that
picks firstAlphabeticalKey uses only keys whose values are non-nil. Reference:
StreamsResult, defaultStream, streams, matchDefaultStreamName,
firstAlphabeticalKey.

In `@support/releaseinfo/releaseinfo_test.go`:
- Around line 206-219: The test currently uses value equality
(g.Expect(result).To(Equal(...))) which can pass for different pointer instances
with identical fields; update the assertions to check pointer identity instead
by replacing Equal(...) with BeIdenticalTo(...) for the StreamForPool results
(e.g., change g.Expect(result).To(Equal(defaultStream)) to
g.Expect(result).To(BeIdenticalTo(defaultStream)) and similarly replace the
other Equal(rhel10Stream)/Equal(rhel9Stream) assertions with
BeIdenticalTo(rhel10Stream)/BeIdenticalTo(rhel9Stream) so the test verifies the
exact pointer returned by StreamForPool on the ReleaseImage fixtures
(ReleaseImage, defaultStream, rhel9Stream, rhel10Stream).

---

Nitpick comments:
In `@hypershift-operator/controllers/nodepool/powervs_test.go`:
- Around line 13-54: Add a happy-path subtest to TestGetPowerVSImage that
constructs a releaseinfo.ReleaseImage whose StreamMetadata contains an entry for
the "ppc64le" architecture with Images.PowerVS including a "us-south" entry
(populate the image struct fields you expect), call getPowerVSImage("us-south",
releaseImage) and assert no error and that the returned image values
(ID/Name/other returned fields) match the expected values using the existing
NewWithT/Expect helpers; place this as an additional element in testCases and
mirror the existing test loop so the success case verifies returned image fields
rather than expecting an error.
🪄 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: 2087aabc-7853-499c-b1de-55617f3d2f8b

📥 Commits

Reviewing files that changed from the base of the PR and between 832b848 and f5c80d5.

⛔ Files ignored due to path filters (7)
  • go.sum is excluded by !**/*.sum
  • vendor/github.com/coreos/stream-metadata-go/LICENSE is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/coreos/stream-metadata-go/stream/artifact_utils.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/coreos/stream-metadata-go/stream/rhcos/rhcos.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/coreos/stream-metadata-go/stream/stream.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/coreos/stream-metadata-go/stream/stream_utils.go is excluded by !vendor/**, !**/vendor/**
  • vendor/modules.txt is excluded by !vendor/**, !**/vendor/**
📒 Files selected for processing (26)
  • go.mod
  • hypershift-operator/controllers/nodepool/aws.go
  • hypershift-operator/controllers/nodepool/aws_test.go
  • hypershift-operator/controllers/nodepool/azure.go
  • hypershift-operator/controllers/nodepool/azure_test.go
  • hypershift-operator/controllers/nodepool/gcp_test.go
  • hypershift-operator/controllers/nodepool/kubevirt/kubevirt.go
  • hypershift-operator/controllers/nodepool/kubevirt/kubevirt_test.go
  • hypershift-operator/controllers/nodepool/nodepool_controller.go
  • hypershift-operator/controllers/nodepool/nodepool_controller_test.go
  • hypershift-operator/controllers/nodepool/openstack/openstack.go
  • hypershift-operator/controllers/nodepool/openstack/openstack_test.go
  • hypershift-operator/controllers/nodepool/powervs.go
  • hypershift-operator/controllers/nodepool/powervs_test.go
  • hypershift-operator/controllers/nodepool/token_test.go
  • support/releaseinfo/deserialize.go
  • support/releaseinfo/deserialize_test.go
  • support/releaseinfo/fake/fake.go
  • support/releaseinfo/fixtures/5.0-installer-coreos-bootimages.yaml
  • support/releaseinfo/fixtures/fixtures.go
  • support/releaseinfo/registry_image_content_policies_test.go
  • support/releaseinfo/registry_mirror_provider.go
  • support/releaseinfo/registryclient_provider.go
  • support/releaseinfo/releaseinfo.go
  • support/releaseinfo/releaseinfo_test.go
  • support/releaseinfo/testutils/testutils.go

Comment thread support/releaseinfo/deserialize.go
Comment thread support/releaseinfo/releaseinfo_test.go
…m parsing

Validate the streams map after unmarshal to reject empty maps and nil
entries that would cause Default=nil or a panic in matchDefaultStreamName.
Add a happy-path test for getPowerVSImage covering the success case.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 67.37589% with 46 lines in your changes missing coverage. Please review.
✅ Project coverage is 41.58%. Comparing base (832b848) to head (6acb740).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
support/releaseinfo/deserialize.go 56.25% 22 Missing and 6 partials ⚠️
support/releaseinfo/testutils/testutils.go 0.00% 10 Missing ⚠️
support/releaseinfo/registryclient_provider.go 0.00% 4 Missing ⚠️
...ypershift-operator/controllers/nodepool/powervs.go 57.14% 3 Missing ⚠️
hypershift-operator/controllers/nodepool/azure.go 94.44% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8711      +/-   ##
==========================================
+ Coverage   41.50%   41.58%   +0.08%     
==========================================
  Files         758      758              
  Lines       93689    93931     +242     
==========================================
+ Hits        38882    39064     +182     
- Misses      52070    52116      +46     
- Partials     2737     2751      +14     
Files with missing lines Coverage Δ
hypershift-operator/controllers/nodepool/aws.go 70.02% <100.00%> (+0.17%) ⬆️
...operator/controllers/nodepool/kubevirt/kubevirt.go 69.46% <100.00%> (+0.23%) ⬆️
...erator/controllers/nodepool/nodepool_controller.go 43.26% <100.00%> (+0.12%) ⬆️
...erator/controllers/nodepool/openstack/openstack.go 76.22% <100.00%> (-0.20%) ⬇️
support/releaseinfo/registry_mirror_provider.go 48.00% <100.00%> (+4.52%) ⬆️
support/releaseinfo/releaseinfo.go 51.00% <100.00%> (+5.14%) ⬆️
hypershift-operator/controllers/nodepool/azure.go 89.17% <94.44%> (-1.41%) ⬇️
...ypershift-operator/controllers/nodepool/powervs.go 11.18% <57.14%> (+11.18%) ⬆️
support/releaseinfo/registryclient_provider.go 0.00% <0.00%> (ø)
support/releaseinfo/testutils/testutils.go 0.00% <0.00%> (ø)
... and 1 more

... and 8 files with indirect coverage changes

Flag Coverage Δ
cmd-support 35.04% <57.57%> (+0.18%) ⬆️
cpo-hostedcontrolplane 43.59% <ø> (ø)
cpo-other 43.17% <ø> (ø)
hypershift-operator 51.69% <90.47%> (+0.12%) ⬆️
other 31.56% <ø> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hypershift-jira-solve-ci

hypershift-jira-solve-ci Bot commented Jun 11, 2026

Copy link
Copy Markdown

Test Failure Analysis Complete

Job Information

Test Failure Analysis

Error

support/releaseinfo/releaseinfo_test.go:8:1: File is not properly formatted (gci)
	"github.com/coreos/stream-metadata-go/stream"
^
1 issues:
* gci: 1
make: *** [Makefile:120: lint] Error 1

Summary

The gci (Go Import Organizer) formatter linter detected that the import block in support/releaseinfo/releaseinfo_test.go does not follow the project's required import group ordering. The new github.com/coreos/stream-metadata-go/stream import — added as part of the multi-stream CoreOS boot image parsing feature — is placed in the wrong import group, violating the custom section ordering defined in .golangci.yml.

Root Cause

The project's .golangci.yml defines a strict custom import group ordering via the gci formatter with custom-order: true. The required section order is:

  1. standard — Go standard library
  2. dot — Dot imports (e.g., . "github.com/onsi/gomega")
  3. prefix(github.com/openshift/hypershift) — hypershift-internal imports
  4. prefix(github.com/openshift) — other OpenShift imports
  5. prefix(github.com/aws) — AWS imports
  6. prefix(github.com/Azure) — Azure imports
  7. prefix(k8s.io) — Kubernetes imports
  8. prefix(sigs.k8s.io) — SIG Kubernetes imports
  9. default — all other third-party imports (catch-all)

The current import block in releaseinfo_test.go is:

import (
    "testing"                                                      // group 1: standard ✓
    . "github.com/onsi/gomega"                                     // group 2: dot ✓
    "github.com/coreos/stream-metadata-go/stream"                  // group 9: default ✗ WRONG POSITION
    imageapi "github.com/openshift/api/image/v1"                   // group 4: openshift ✗ WRONG POSITION
    "github.com/openshift/hypershift/support/releaseinfo/fixtures"  // group 3: hypershift ✗ WRONG POSITION
)

Three violations exist:

  1. github.com/coreos/stream-metadata-go/stream (group 9 — default) is placed between the dot imports (group 2) and OpenShift imports (groups 3–4), but must come last.
  2. github.com/openshift/hypershift/... (group 3) is placed after github.com/openshift/api/... (group 4), but group 3 must precede group 4.
  3. All three non-standard, non-dot groups are in a single import block with no blank-line separation between groups.

The correct import ordering should be:

import (
    "testing"

    . "github.com/onsi/gomega"

    "github.com/openshift/hypershift/support/releaseinfo/fixtures"

    imageapi "github.com/openshift/api/image/v1"

    "github.com/coreos/stream-metadata-go/stream"
)
Recommendations
  1. Fix the import ordering in support/releaseinfo/releaseinfo_test.go: Reorder imports to match the gci sections defined in .golangci.yml. Each section group must be separated by a blank line, and the github.com/coreos/stream-metadata-go/stream import must be placed in the final default group.

  2. Run the formatter locally before pushing: golangci-lint fmt or make lint will auto-fix gci formatting issues. Alternatively, run gci write --custom-order -s standard -s dot -s 'prefix(github.com/openshift/hypershift)' -s 'prefix(github.com/openshift)' -s 'prefix(github.com/aws)' -s 'prefix(github.com/Azure)' -s 'prefix(k8s.io)' -s 'prefix(sigs.k8s.io)' -s default support/releaseinfo/releaseinfo_test.go.

  3. Check other new/modified files in this PR for the same issue — the coreos/stream-metadata-go import is new to this PR and may appear in other changed files (e.g., deserialize.go, deserialize_test.go) with the same misordering.

Evidence
Evidence Detail
Failing file support/releaseinfo/releaseinfo_test.go:8:1
Linter gci (Go Import Organizer), configured as a formatter in .golangci.yml
Violation "github.com/coreos/stream-metadata-go/stream" placed in wrong import group
Config location .golangci.ymlformatters.settings.gci.sections with custom-order: true
Expected group default (catch-all, last group)
Actual position Between dot (group 2) and prefix(github.com/openshift) (group 4)
Total lint issues 1 (all other 1021 issues were filtered/excluded by rules)
Build log line make: *** [Makefile:120: lint] Error 1

@sdminonne

Copy link
Copy Markdown
Contributor Author

Addressed the nitpick for powervs_test.go in 6acb740: added a happy-path test case for getPowerVSImage that constructs valid ppc64le stream metadata with a PowerVS region entry, calls getPowerVSImage, and asserts correct image fields including the dot-to-hyphen replacement in the release name.

@sdminonne sdminonne marked this pull request as ready for review June 11, 2026 13:01
@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 Jun 11, 2026
@openshift-ci openshift-ci Bot requested a review from enxebre June 11, 2026 13:02
@openshift-ci

openshift-ci Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

@sdminonne: 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.

@sdminonne

Copy link
Copy Markdown
Contributor Author

Superseded by #8669

@sdminonne sdminonne closed this Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release area/platform/aws PR/issue for AWS (AWSPlatform) platform area/platform/azure PR/issue for Azure (AzurePlatform) platform area/platform/gcp PR/issue for GCP (GCPPlatform) platform area/platform/kubevirt PR/issue for KubeVirt (KubevirtPlatform) platform area/platform/openstack PR/issue for OpenStack (OpenStackPlatform) platform area/platform/powervs PR/issue for PowerVS (PowerVSPlatform) platform 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