Skip to content

[WIP] use machine-config-osimagestream to avoid hard-coding image tag names#10416

Draft
cheesesashimi wants to merge 1 commit intoopenshift:mainfrom
cheesesashimi:zzlotnik/add-machine-config-osimagestream-extract-binary
Draft

[WIP] use machine-config-osimagestream to avoid hard-coding image tag names#10416
cheesesashimi wants to merge 1 commit intoopenshift:mainfrom
cheesesashimi:zzlotnik/add-machine-config-osimagestream-extract-binary

Conversation

@cheesesashimi
Copy link
Member

No description provided.

@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 Mar 20, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 20, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Excluded labels (none allowed) (1)
  • do-not-merge/work-in-progress

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2a5a13e3-106b-44d4-9e63-531c153d4a6c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 20, 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 openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 20, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 20, 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

@cheesesashimi cheesesashimi force-pushed the zzlotnik/add-machine-config-osimagestream-extract-binary branch from ab08bb0 to 5f7f1bc Compare March 20, 2026 19:41
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 20, 2026
# Note: Proxy environment variables (HTTP_PROXY, HTTPS_PROXY, NO_PROXY) are
# automatically inherited from the environment if set via /etc/profile.d/proxy.sh
until COREOS_IMAGE=$("${TEMP_DIR}/machine-config-osimagestream" \
get default-node-image \
Copy link
Contributor

Choose a reason for hiding this comment

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

Well, we don't want the default OS image, we need to return the OS image install-config points too.
We need to pass it by using

type bootstrapTemplateData struct {

We can use this PR to remove the StreamTag field we won't use anymore.

Copy link
Member Author

Choose a reason for hiding this comment

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

I removed the StreamTag field and tried to just use the OSImageStream field. Unless this is explicitly set, it is empty. I pushed up a change that branches based upon whether this is set and will call default-node-image when that is the case. However, I don't think that is the right path forward because what should be the source of truth for the default value? Should it be the OSImageStream code in the MCO repo? Or should it be the code here?

Comment on lines +28 to +30
--authfile /root/.docker/config.json \
--per-host-certs /etc/containers/certs.d \
--registry-config /etc/containers/registries.conf); do
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we rely on the defaults? (Just asking not a blocking question or ask for change)

Copy link
Member Author

Choose a reason for hiding this comment

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

In #10406, I don't think we can rely on the defaults since machine-config-osimagestream will be running containerized. However, I think we can rely on the defaults here. I need to look at https://github.com/containers/image to see if there is a SetDefaultValues() function someplace for types.SystemContext. If not, then I'll put these values into the machine-config-osimagestream entrypoint as the default values.

@cheesesashimi cheesesashimi force-pushed the zzlotnik/add-machine-config-osimagestream-extract-binary branch from 5f7f1bc to dddbd35 Compare March 23, 2026 17:30
Copy link
Contributor

@patrickdillon patrickdillon left a comment

Choose a reason for hiding this comment

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

What's bad about hardcoding the images? Is it because there are potentially more streams than rhcos9 & rhcos10, and we don't want to teach the installer about all of those?

Comment on lines +17 to +20
# Extract the machine-config-osimagestream binary from the MCO image. This avoids having to munge podman args, paths, env vars, etc.
podman create --name mco-osimagestream "${MCO_IMAGE}"
podman cp mco-osimagestream:/usr/bin/machine-config-osimagestream "${TEMP_DIR}/machine-config-osimagestream"
podman rm mco-osimagestream
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use podman run via

bootkube_podman_run() {
# we run all commands in the host-network to prevent IP conflicts with
# end-user infrastructure.
podman run --quiet --net=host --rm --log-driver=k8s-file "${@}"
}

If so, would be a little cleaner, but I'm not sure we can. Just an idea/suggestion.

Copy link
Member Author

Choose a reason for hiding this comment

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

So, I tried to do this in a different PR. While I eventually got it to work, it seemed really brittle.

@cheesesashimi cheesesashimi force-pushed the zzlotnik/add-machine-config-osimagestream-extract-binary branch from dddbd35 to 43dd650 Compare March 23, 2026 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants