Skip to content

MCO-2200: Add day-0 dual streams support for ABI install flow#10481

Open
isabella-janssen wants to merge 4 commits intoopenshift:mainfrom
isabella-janssen:mco-2200-claude
Open

MCO-2200: Add day-0 dual streams support for ABI install flow#10481
isabella-janssen wants to merge 4 commits intoopenshift:mainfrom
isabella-janssen:mco-2200-claude

Conversation

@isabella-janssen
Copy link
Copy Markdown
Member

@isabella-janssen isabella-janssen commented Apr 8, 2026

Note that much of this PR was created with Claude.

Summary by CodeRabbit

  • New Features

    • Agent-based installations now support configurable OS image streams (rhel-9, rhel-10) and will adapt selection based on install configuration and workflow type.
    • Minimal ISO generation now incorporates optional install configuration when resolving root filesystem sources.
  • Tests

    • Expanded tests for OS image stream validation.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 8, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: efaea238-f210-4e7b-b2b5-14e7a976a42a

📥 Commits

Reviewing files that changed from the base of the PR and between 5c23add and 73ee43d.

📒 Files selected for processing (7)
  • pkg/asset/agent/image/agentimage.go
  • pkg/asset/agent/image/baseiso.go
  • pkg/asset/agent/image/ignition.go
  • pkg/asset/agent/manifests/agent.go
  • pkg/asset/agent/manifests/agent_test.go
  • pkg/asset/manifests/osimagestream.go
  • pkg/types/validation/installconfig_test.go
🚧 Files skipped from review as they are similar to previous changes (5)
  • pkg/asset/agent/image/agentimage.go
  • pkg/asset/agent/manifests/agent_test.go
  • pkg/asset/manifests/osimagestream.go
  • pkg/asset/agent/image/ignition.go
  • pkg/types/validation/installconfig_test.go

Walkthrough

Assets for agent-driven installs now accept an optional install configuration and agent workflow info; this is threaded into OS image stream selection and rootFS URL resolution, and OSImageStream manifest generation is conditionally suppressed for non-install agent workflows.

Changes

Cohort / File(s) Summary
Agent image assets
pkg/asset/agent/image/agentimage.go, pkg/asset/agent/image/baseiso.go, pkg/asset/agent/image/ignition.go
Added agent.OptionalInstallConfig dependency and instantiate/pass installConfig into dependencies.Get(...). getRootFSURL and customStreamGetter now accept installConfig to select OS image streams (including an RHCOS fetch path using installConfig.Config.OSImageStream).
Agent manifests asset & tests
pkg/asset/agent/manifests/agent.go, pkg/asset/agent/manifests/agent_test.go
Declared dependency on manifests.OSImageStream, included it in generation loop, and updated tests to include the optional OSImageStream asset.
OSImageStream manifest logic
pkg/asset/manifests/osimagestream.go
Added dependencies on agent.OptionalInstallConfig and workflow.AgentWorkflow. Generate selects config from IPI InstallConfig or agent OptionalInstallConfig, and only produces manifests when appropriate (IPI or agent workflow == Install); otherwise returns nil.
Validation tests
pkg/types/validation/installconfig_test.go
Removed duplicated invalid-OSImageStream test entry and adjusted remaining test entries (global SCOS state handling simplified/changed).

Sequence Diagram(s)

sequenceDiagram
    participant AgentManifests
    participant OSImageStream
    participant InstallConfig
    participant AgentWorkflow
    participant RHCOSFetcher

    AgentManifests->>OSImageStream: Generate()
    OSImageStream->>InstallConfig: Ask for IPI InstallConfig
    alt IPI InstallConfig present
        InstallConfig-->>OSImageStream: Provide IPI config (OSImageStream)
        OSImageStream->>RHCOSFetcher: Use OSImageStream to fetch metadata
        RHCOSFetcher-->>OSImageStream: Return image stream / metadata
        OSImageStream-->>AgentManifests: Return manifest
    else No IPI config, agent OptionalInstallConfig present
        OSImageStream->>InstallConfig: Check agent OptionalInstallConfig
        alt AgentWorkflow == Install
            AgentWorkflow-->>OSImageStream: Confirm Install workflow
            OSImageStream->>RHCOSFetcher: Use agent OSImageStream to fetch metadata
            RHCOSFetcher-->>OSImageStream: Return image stream / metadata
            OSImageStream-->>AgentManifests: Return manifest
        else Other agent workflow
            OSImageStream-->>AgentManifests: Return nil (no manifest)
        end
    else No config available
        OSImageStream-->>AgentManifests: Return nil (no manifest)
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 8 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Structure And Quality ❓ Inconclusive The custom check targets Ginkgo test patterns, but the modified test files use standard Go table-driven tests without any Ginkgo constructs. Clarify whether this check applies only to Ginkgo tests or should also cover standard Go tests; if the latter, add descriptive failure messages to all assertions.
✅ Passed checks (8 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding day-0 dual streams support for ABI (Agent-Based Installation) install flow, which aligns with the changeset's focus on enabling OSImageStream configuration across agent image and manifest assets.
Stable And Deterministic Test Names ✅ Passed All test names in modified test files are static, descriptive strings without dynamic content like UUIDs, timestamps, or pod/node names.
Microshift Test Compatibility ✅ Passed This PR contains only standard Go unit tests using the testing package, not Ginkgo e2e tests.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This PR does not add any Ginkgo e2e tests. Modified test files contain only standard Go unit tests using the testing package and testify assertions. Changes are limited to extending existing unit test coverage by adding the OSImageStream asset to test inputs and adding a new validation test case. No Ginkgo constructs like Describe(), It(), Context(), or When() are present in modified source files.
Topology-Aware Scheduling Compatibility ✅ Passed PR modifies asset generators for agent-based installation (ISO, ignition, OS image stream config) without introducing topology-dependent pod scheduling constraints.
Ote Binary Stdout Contract ✅ Passed PR modifies installer asset definition files, not OTE test binaries. No process-level code or stdout writes found.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR does not add new Ginkgo e2e tests; only standard Go unit tests with no Ginkgo patterns detected.

✏️ 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.11.4)

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


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

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 8, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented Apr 8, 2026

@isabella-janssen: This pull request references MCO-2200 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 "4.22.0" version, but no target version was set.

Details

In response to this:

Note that much of this PR was created with Claude.

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 added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 8, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 8, 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 Apr 8, 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 zaneb 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

Comment thread data/data/install.openshift.io_installconfigs.yaml Outdated
Comment thread pkg/rhcos/stream.go Outdated
Comment thread pkg/asset/agent/image/baseiso.go Outdated
Comment thread pkg/asset/agent/image/baseiso_test.go Outdated
Comment thread pkg/asset/manifests/osimagestream.go Outdated
@isabella-janssen isabella-janssen force-pushed the mco-2200-claude branch 3 times, most recently from 82f8861 to 5c23add Compare April 14, 2026 18:08
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented Apr 14, 2026

@isabella-janssen: This pull request references MCO-2200 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:

Note that much of this PR was created with Claude.

Summary by CodeRabbit

  • New Features

  • Agent-based installations now support configurable OS image streams (rhel-9, rhel-10) for greater flexibility in OS selection

  • OS image selection logic improved to intelligently adapt based on installation configuration and workflow type

  • Tests

  • Expanded test coverage for OS image stream validation and error handling

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.

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

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

Inline comments:
In `@pkg/types/validation/installconfig_test.go`:
- Around line 3038-3043: The restoreFnFactory in the test sets types.SCOS =
false unconditionally and must instead capture the original value and restore it
after the test; update the restoreFnFactory closure to save orig := types.SCOS,
then return a func() that sets types.SCOS = orig so the test (and parallel
tests) do not mutate global state permanently—apply this change to the
restoreFnFactory used alongside expectedError in the InstallConfig tests.
🪄 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: Pro Plus

Run ID: 7510ad2f-b046-42cd-9a85-96a75689d6f4

📥 Commits

Reviewing files that changed from the base of the PR and between 075b809 and 5c23add.

📒 Files selected for processing (7)
  • pkg/asset/agent/image/agentimage.go
  • pkg/asset/agent/image/baseiso.go
  • pkg/asset/agent/image/ignition.go
  • pkg/asset/agent/manifests/agent.go
  • pkg/asset/agent/manifests/agent_test.go
  • pkg/asset/manifests/osimagestream.go
  • pkg/types/validation/installconfig_test.go

Comment thread pkg/types/validation/installconfig_test.go
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented Apr 14, 2026

@isabella-janssen: This pull request references MCO-2200 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:

Note that much of this PR was created with Claude.

Summary by CodeRabbit

  • New Features

  • Agent-based installations now support configurable OS image streams (rhel-9, rhel-10) and will adapt selection based on install configuration and workflow type.

  • Minimal ISO generation now incorporates optional install configuration when resolving root filesystem sources.

  • Bug Fixes

  • OS image stream generation is suppressed for non-install agent workflows to avoid inappropriate outputs.

  • Tests

  • Expanded tests for OS image stream validation and error handling.

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 added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 17, 2026
Comment thread pkg/asset/manifests/osimagestream.go Outdated
Comment thread pkg/asset/agent/image/baseiso.go Outdated
}

// For install workflow, use osImageStream from install-config if supplied
if installConfig.Supplied && installConfig.Config != nil {
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.

The original motivation of the customStreamGetter was to provide an alternative (custom) way to retrieve the bootimages data - because in the day2 add scenario we wanted to reuse the values found in the target cluster (from the coreos-bootimages configmap) rather than the "default" values embedded in the installer.
This approach technically works, but I was expecting an implementation more focused on the defaultCoreOSStreamGetter (or at least part of GetMetalArtifact). I understand that it may be more complex from an implementation point of view, but I was wondering if it could be worth rethinking that part so that the OSImageStream field could be considered a part of the default implementation, rather than a special custom one (based on writing a dedicated asset for that)

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 tried integrating the suggestion here to have the implementation more focused in GetMetalArtifact, so hopefully the current state of this PR is closer to what you were expecting.

@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 17, 2026
@pablintino
Copy link
Copy Markdown
Contributor

Hey @isabella-janssen! Just one thing based on the discussions we have had with the AS folks.
We need to add the osImageStream field to this struct and initialize it.

icOverrides := agentClusterInstallInstallConfigOverrides{}

@isabella-janssen
Copy link
Copy Markdown
Member Author

/test ?

@isabella-janssen
Copy link
Copy Markdown
Member Author

/test verify-codegen

@isabella-janssen
Copy link
Copy Markdown
Member Author

/test gofmt

@isabella-janssen
Copy link
Copy Markdown
Member Author

/test golint

@isabella-janssen
Copy link
Copy Markdown
Member Author

isabella-janssen commented Apr 20, 2026

/test golint
/test verify-codegen
/test golint

@isabella-janssen
Copy link
Copy Markdown
Member Author

/test all

@isabella-janssen
Copy link
Copy Markdown
Member Author

/retest-required

@isabella-janssen isabella-janssen marked this pull request as ready for review April 21, 2026 18:20
@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 Apr 21, 2026
@openshift-ci openshift-ci Bot requested review from bfournie and dtantsur April 21, 2026 18:21
@isabella-janssen
Copy link
Copy Markdown
Member Author

Hey @isabella-janssen! Just one thing based on the discussions we have had with the AS folks.
We need to add the osImageStream field to this struct and initialize it.

@pablintino this change should be there now, thank you for the reminder!

Comment thread pkg/asset/agent/image/ignition.go Outdated
&mirror.CaBundle{},
&gencrypto.AuthConfig{},
&common.InfraEnvID{},
&agentcommon.OptionalInstallConfig{},
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.

Adding a comment here since it's one of the latest asset in the agent graph. ABI must support installing a cluster either by using install-config.yaml + agent-config.yaml or by ZTP manifests.
Internally we transform the install-config + agent-config in a set of ZTP manifests (grouped in AgentManifests), and then they are used to generate the subsequent agent Ignition and ISO artifacts.
I think it would be a lot easier if at least the field was available in a ZTP manifest, but I think we agreed to add it later.
For such reasons, and also to make it easier update in future the code, I think it'd be better to create a simple asset (ie OSImageStreamField or any other reasonable name) that will simply extract the install-config.yaml osimagestream and expose it as a value so just with the OptionalInstallConfig as a dependency). This asset then could be added as a dependency whenever the osimagestream field is required, decoupling thus the dependency on OptionalInstallConfig for the other assets in the agent graph.


if installConfig.Config.OSImageStream != "" {
icOverridden = true
icOverrides.OSImageStream = installConfig.Config.OSImageStream
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

Comment thread pkg/asset/manifests/osimagestream.go Outdated
installConfig := &installconfig.InstallConfig{}
dependencies.Get(installConfig)

// Then try agent optional install config
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Unfortunately, I don't think this works. Unlike OptionalInstallConfig, InstallConfig is not optional, so adding it to the agent dependency graph will break things that are supposed to work even if you don't have an install-config.

I think you will need to create a separate AgentOSImageStream asset.

Creates separate AgentOSImageStream asset for Agent workflows to avoid
breaking ZTP-only deployments. IPI OSImageStream depends on required
InstallConfig, while AgentOSImageStream depends on OptionalInstallConfig
and can work without install-config.yaml.
@dkhater-redhat
Copy link
Copy Markdown

@zaneb PTAL

Comment thread pkg/asset/agent/image/baseiso.go Outdated
func (i *BaseIso) getRootFSURL(ctx context.Context, archName string, agentWorkflow *workflow.AgentWorkflow, clusterInfo *joiner.ClusterInfo) (string, error) {
metal, err := rhcos.GetMetalArtifact(
ctx, archName, customStreamGetter(agentWorkflow, clusterInfo))
func (i *BaseIso) getRootFSURL(ctx context.Context, archName string, agentWorkflow *workflow.AgentWorkflow, clusterInfo *joiner.ClusterInfo, osImageStream *manifests.AgentOSImageStream) (string, error) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: could pass just the .Stream itself rather than the whole asset here.

Comment thread pkg/asset/agent/manifests/agent.go Outdated
&AgentClusterInstall{},
&ClusterDeployment{},
&ClusterImageSet{},
&manifests.OSImageStream{},
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not sure what this dependency is doing at the moment tbh.

}

// TODO: Add fallback to AgentClusterInstall.Spec.OSImageStream once
// the field is available in the assisted-service API
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If we're storing this in the installConfigOverrides of AgentClusterInstall, then we should really be reading it from there and not from the install-config directly. (User could do agent create cluster-manifests and then manually edit AgentClusterInstall, and we should abide by that.)


// Only generate for install workflow, not add-nodes
if agentWorkflow.Workflow != workflow.AgentWorkflowTypeInstall {
return nil
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For add-nodes we really need to ask the cluster what the default install stream is, since the user can configure this at runtime IIUC.

- Pass stream value instead of whole asset to getRootFSURL
- Remove IPI OSImageStream dependency from AgentManifests
- Read from AgentClusterInstall.installConfigOverrides (Layer 2)
- Query cluster OSImageStream CR for add-nodes workflow
RHEL 10 uses different file naming in machine-os-images container:
- rhel-9: /coreos/coreos-{arch}.iso
- rhel-10: /coreos/coreos10-{arch}.iso

Updated releaseextract to use stream-aware file path helpers:
- getCoreOsFileName()
- getCoreOsSha256FileName()
- getCoreOsStreamFileName()

Without this fix, rhel-10 deployments fail when extracting the boot
ISO from the release payload.
Comment on lines +37 to +61
// getCoreOsFileName returns the ISO file path in machine-os-images based on stream.
func getCoreOsFileName(stream types.OSImageStream, architecture string) string {
// rhel-10 uses coreos10- prefix, rhel-9 uses coreos- prefix
if stream == types.OSImageStreamRHCOS10 {
return fmt.Sprintf("/coreos/coreos10-%s.iso", architecture)
}
return fmt.Sprintf("/coreos/coreos-%s.iso", architecture)
}

// getCoreOsSha256FileName returns the ISO checksum file path based on stream.
func getCoreOsSha256FileName(stream types.OSImageStream, architecture string) string {
if stream == types.OSImageStreamRHCOS10 {
return fmt.Sprintf("/coreos/coreos10-%s.iso.sha256", architecture)
}
return fmt.Sprintf("/coreos/coreos-%s.iso.sha256", architecture)
}

// getCoreOsStreamFileName returns the stream metadata file path based on stream.
func getCoreOsStreamFileName(stream types.OSImageStream) string {
if stream == types.OSImageStreamRHCOS10 {
return "/coreos/coreos10-stream.json"
}
return "/coreos/coreos-stream.json"
}

Copy link
Copy Markdown
Contributor

@pablintino pablintino May 5, 2026

Choose a reason for hiding this comment

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

Terrible (not your fault). The naming in the openshift-os-images is a bit of a nightmare to align with our stream names, but, why not somehing like this:

func getCoreOSFilePrefix(stream types.OSImageStream) string {
    prefix := "coreos"
    if stream != types.OSImageStreamRHCOS9 {
        stremParts := strings.SplitN(string(stream), "-", 2)
        if len(stremParts) > 1 {
            prefix += stremParts[1]
        }
    }
    return prefix
}

// getCoreOsFileName returns the ISO file path in machine-os-images based on stream.
func getCoreOsFileName(stream types.OSImageStream, architecture string) string {
    return fmt.Sprintf("/coreos/%s-%s.iso", getCoreOSFilePrefix(stream), architecture)
}

// getCoreOsSha256FileName returns the ISO checksum file path based on stream.
func getCoreOsSha256FileName(stream types.OSImageStream, architecture string) string {
    return fmt.Sprintf("/coreos/%s-%s.iso.sha256", getCoreOSFilePrefix(stream), architecture)
}

// getCoreOsStreamFileName returns the stream metadata file path based on stream.
func getCoreOsStreamFileName(stream types.OSImageStream) string {
    return fmt.Sprintf("/coreos/%s-stream.json", getCoreOSFilePrefix(stream))
}

We can try to agree with them the next ISO additions to follow the same pattern, eg. for the RHEL4NV work.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 5, 2026

@isabella-janssen: The following tests 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-agent-compact-ipv4-rhel10-techpreview ac9df48 link false /test e2e-agent-compact-ipv4-rhel10-techpreview
ci/prow/e2e-metal-single-node-live-iso ac9df48 link false /test e2e-metal-single-node-live-iso
ci/prow/e2e-agent-compact-ipv4-appliance-diskimage ac9df48 link false /test e2e-agent-compact-ipv4-appliance-diskimage
ci/prow/unit ac9df48 link true /test unit
ci/prow/e2e-metal-ovn-two-node-fencing ac9df48 link false /test e2e-metal-ovn-two-node-fencing
ci/prow/e2e-agent-two-node-fencing-ipv4 ac9df48 link false /test e2e-agent-two-node-fencing-ipv4
ci/prow/e2e-agent-ha-dualstack-rhel10-techpreview ac9df48 link false /test e2e-agent-ha-dualstack-rhel10-techpreview

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.

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.

The name of this asset file should be agentosimagestream.go

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.

It'd be nice also to have a dedicated test file for this new asset

return []asset.Asset{
&workflow.AgentWorkflow{},
&joiner.ClusterInfo{},
&AgentManifests{},
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 works, but since the current asset requires only AgentClusterInstall it should be sufficient to have, as a dependency, just &manifests.AgentClusterInstall{} (useful to minimize the dependency requirements)

// getStreamFromCluster queries the cluster's OSImageStream CR to determine
// the default stream.
func (a *AgentOSImageStream) getStreamFromCluster(ctx context.Context, client mcfgclient.Interface) (types.OSImageStream, error) {
osImageStream, err := client.MachineconfigurationV1alpha1().OSImageStreams().Get(ctx, "cluster", metav1.GetOptions{})
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 does not look correct, since it's a ClusterInfo responsibility to retrieve the osImageStream. The current asset should just fetch this information from the ClusterInfo dependency (through a field), and leave to ClusterInfo the decision on how to retrieve it. So the extraction logic should be refactored inside ClusterInfo

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.

Given the new specific agen asset AgenOSImageStream, all the changes here don't seem to still needed, isn't it?


var stream types.OSImageStream

switch agentWorkflow.Workflow {
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 is a slightly unusual pattern, since usually this kind of logic (discriminating between the Install and AddNodes workflow) is applied directly into the assets that need to consume the dependencies values.
In this case the asset does not consume the field but hides the implementation details about osImageStream retrieval, and exposes directly the value as a field meant to be consumed by other assets.
The good point is that, since this field is required by many different consumer, the retrieval logic is not duplicated across them, but remains centralized here (so fewer risks of different usages in different places). The drawback is that such logic remains a little bit less visible in the asset consumer code (as it keeps having its own workflow discriminating logic).
Even though I'm a little bit more inclined to improved readability, I'm not opposed to such approach

&AgentClusterInstall{Config: fakeAgentClusterInstall},
&ClusterDeployment{Config: fakeClusterDeployment},
&ClusterImageSet{Config: fakeClusterImageSet},
&manifests.OSImageStream{},
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.

As mentioned before, very likely this will not be required

return err
}
osImage, err := getOSImagesInfo(ctx, archName, openshiftVersion, nil)
osImage, err := getOSImagesInfo(ctx, archName, openshiftVersion, nil, "")
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.

nit: for readability, rather than an empty string a more speaking constant could be better

Comment thread pkg/asset/rhcos/iso.go
func NewBaseISOFetcher(ocRelease ReleasePayload, streamGetter CoreOSBuildFetcher, osImageStream types.OSImageStream) *BaseIso {
if streamGetter == nil {
streamGetter = defaultCoreOSStreamGetter
if osImageStream != "" {
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.

Note: a little bit more of "happy path" could help in making the code more readable here.

Anyhow it looks like here the code it's getting more complicated, and I'd like to have another pass to see if we could simplify a little bit.

@dkhater-redhat
Copy link
Copy Markdown

/hold for #10534

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 6, 2026
@dkhater-redhat
Copy link
Copy Markdown

updated refactor PR- #10537

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. 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.

7 participants