Skip to content

OKD-322: Update UPI dockerfile to work on CentOS/RHEL 10#10322

Closed
jatinsu wants to merge 2 commits intoopenshift:mainfrom
jatinsu:cs10-fix
Closed

OKD-322: Update UPI dockerfile to work on CentOS/RHEL 10#10322
jatinsu wants to merge 2 commits intoopenshift:mainfrom
jatinsu:cs10-fix

Conversation

@jatinsu
Copy link
Copy Markdown
Contributor

@jatinsu jatinsu commented Feb 18, 2026

GCloud cli repo has changed for CentOS/RHEL 10 based images. Documentation that I used to update this is here: https://docs.cloud.google.com/sdk/docs/install-sdk#rpm. The reason for this PR now is because OKD is attempting to use CentOS 10 base images in 4.22 onward, and the upi installer is failing because of the outdated Gcloud repo.

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

openshift-ci-robot commented Feb 18, 2026

@jatinsu: This pull request references OKD-322 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:

Gcloud cli repo has changed for CentOS/RHEL 10 based images. Documentation that I used to update this is here: https://docs.cloud.google.com/sdk/docs/install-sdk#rpm

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.

@jatinsu jatinsu changed the title OKD-322: Update UPI dockerfile to work on rhel10/centos10 OKD-322: Update UPI dockerfile to work on CentOS/RHEL 10 Feb 18, 2026
@openshift-ci openshift-ci bot requested review from barbacbd and bfournie February 18, 2026 16:54
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Feb 18, 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 andfasano 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 images/installer/Dockerfile.upi.ci Outdated
yum install --setopt=tsflags=nodocs -y \
gettext \
google-cloud-cli-447.0.0-1 \
google-cloud-cli \
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.

447.0.0-1 isn't in the rhel 10 repo anymore. This pin is related to https://issues.redhat.com/browse/OCPBUGS-22830. How can I test to see if this issue still exists?

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.

Just bump it to a newer version (you should pin it to a specific version so it doesn't break) and you can run a gcp upi presubmit test on the pr

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.

@jatinsu can you pin this to a specific version please?

Copy link
Copy Markdown
Contributor Author

@jatinsu jatinsu Mar 23, 2026

Choose a reason for hiding this comment

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

Just pinned it. I had to move the version check into the install command since rhel 9 doesn't have 561 (I also made the if condition to be much simpler, I didn't notice that there was a platform ID)

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented Feb 18, 2026

@jatinsu: This pull request references OKD-322 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:

GCloud cli repo has changed for CentOS/RHEL 10 based images. Documentation that I used to update this is here: https://docs.cloud.google.com/sdk/docs/install-sdk#rpm. The reason for this PR now is because OKD is attempting to use CentOS 10 base images in 4.22 onward, and the upi installer is failing because of the outdated Gcloud repo.

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.

@jatinsu
Copy link
Copy Markdown
Contributor Author

jatinsu commented Feb 23, 2026

/retest-required

Comment thread images/installer/Dockerfile.upi.ci Outdated
Comment on lines +52 to +59
RUN . /etc/os-release && \
MAJOR_VERSION=$(echo "${VERSION_ID}" | cut -d. -f1) && \
if [ "${MAJOR_VERSION}" = "10" ]; then \
sh -c 'echo -e "[google-cloud-cli]\nname=Google Cloud CLI\nbaseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el10-x86_64\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=0\ngpgkey=https://packages.cloud.google.com/yum/doc/rpm-package-key-v10.gpg" > /etc/yum.repos.d/google-cloud-sdk.repo'; \
else \
sh -c 'echo -e "[google-cloud-cli]\nname=Google Cloud CLI\nbaseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el9-x86_64\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=0\ngpgkey=https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg" > /etc/yum.repos.d/google-cloud-sdk.repo'; \
fi

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.

Isn't this image always rhel9 (see the builder image on line 9? I don't think we want to make this conditional

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.

OKD is attempting to move to CentOS 10, and the way we do this is by replacing the base image with a cs10 image. That's why there's a conditional. If you prefer I could do it based of a installation failure similar to what is done here.

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.

@patrickdillon Sorry, would you mind taking a look again? I can change the conditional to what's done here if needed

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.

OKD is attempting to move to CentOS 10, and the way we do this is by replacing the base image with a cs10 image.

This UPI image is only used to host tools to interact with cloud sdks and do tasks in CI steps... the base image here shouldn't really have any effect on okd?

Copy link
Copy Markdown
Contributor Author

@jatinsu jatinsu Mar 23, 2026

Choose a reason for hiding this comment

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

This UPI image is only used to host tools to interact with cloud sdks and do tasks in CI steps... the base image here shouldn't really have any effect on okd?

So the reason why the base image affects OKD is because this UPI image is actually built separately for OKD, and the UPI installer fails at build time when the base image is swapped to CentOS 10. Do you think it'd make more sense to keep the base image as is? I think art has historically always replaced it iirc.

Here's the failure logs that happen when we swap the base image to CentOS 10 if you want some more context. Sorry for the initial confusion!

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.

Yes i think that makes more sense, because we would be removing an incorrect config and not adding more complexity.

This upi image should be changed ao we mirror it rather than build in ci

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.

I say “incorrect “ because this image really has no consequence on okd, the installer is copied in from another image

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.

Just got back from the ART team. I'll close this PR, we'll continue with using rhel9. Thanks for looking at this!

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 23, 2026

Walkthrough

Updated the CI builder base image to a newer version (golang 1.25, OpenShift 4.22). Made google-cloud-cli installation platform-aware, using different versions and repository configurations for EL10 versus EL9 systems based on /etc/os-release detection.

Changes

Cohort / File(s) Summary
Docker CI Configuration
images/installer/Dockerfile.upi.ci
Updated base image version; replaced static google-cloud-cli repo configuration with conditional logic that selects EL10-specific repo and package version (561.0.0-1.el10) or EL9-specific repo and version (447.0.0-1) based on system platform ID.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

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

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

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.

🧹 Nitpick comments (1)
images/installer/Dockerfile.upi.ci (1)

52-59: Fail fast for unsupported platforms instead of defaulting to EL9.

Right now, any non-platform:el10 value falls into the EL9 branch. That can mask future base-image changes and produce confusing package failures. Prefer explicit el9/el10 handling with an error for anything else.

Suggested refactor
 RUN . /etc/os-release && \
-    if [ "${PLATFORM_ID}" = "platform:el10" ]; then \
+    if [ "${PLATFORM_ID}" = "platform:el10" ]; then \
       echo -e "[google-cloud-cli]\nname=Google Cloud CLI\nbaseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el10-x86_64\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=0\ngpgkey=https://packages.cloud.google.com/yum/doc/rpm-package-key-v10.gpg" > /etc/yum.repos.d/google-cloud-sdk.repo; \
       GOOGLE_CLOUD_CLI_PKG="google-cloud-cli-561.0.0-1.el10"; \
-    else \
+    elif [ "${PLATFORM_ID}" = "platform:el9" ]; then \
       echo -e "[google-cloud-cli]\nname=Google Cloud CLI\nbaseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el9-x86_64\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=0\ngpgkey=https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg" > /etc/yum.repos.d/google-cloud-sdk.repo; \
       GOOGLE_CLOUD_CLI_PKG="google-cloud-cli-447.0.0-1"; \
+    else \
+      echo "Unsupported PLATFORM_ID: ${PLATFORM_ID}" >&2; \
+      exit 1; \
     fi && \

As per coding guidelines, **: -Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@images/installer/Dockerfile.upi.ci` around lines 52 - 59, The current
conditional treats any non-`platform:el10` as EL9 which can mask unsupported
platforms; modify the conditional around the sourced PLATFORM_ID (from
/etc/os-release) to explicitly handle `platform:el10` and `platform:el9`
(setting the google-cloud repo content and GOOGLE_CLOUD_CLI_PKG accordingly) and
add an else branch that prints a clear error to stderr and exits non-zero to
fail fast for unsupported PLATFORM_ID values; update the block that writes
/etc/yum.repos.d/google-cloud-sdk.repo and sets GOOGLE_CLOUD_CLI_PKG to reflect
these three explicit branches.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@images/installer/Dockerfile.upi.ci`:
- Around line 52-59: The current conditional treats any non-`platform:el10` as
EL9 which can mask unsupported platforms; modify the conditional around the
sourced PLATFORM_ID (from /etc/os-release) to explicitly handle `platform:el10`
and `platform:el9` (setting the google-cloud repo content and
GOOGLE_CLOUD_CLI_PKG accordingly) and add an else branch that prints a clear
error to stderr and exits non-zero to fail fast for unsupported PLATFORM_ID
values; update the block that writes /etc/yum.repos.d/google-cloud-sdk.repo and
sets GOOGLE_CLOUD_CLI_PKG to reflect these three explicit branches.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cddfd450-de10-4a28-b86b-6ad37e10cbfa

📥 Commits

Reviewing files that changed from the base of the PR and between b0514c8 and 3793c23.

📒 Files selected for processing (1)
  • images/installer/Dockerfile.upi.ci

@jatinsu
Copy link
Copy Markdown
Contributor Author

jatinsu commented Mar 24, 2026

/retest-required

1 similar comment
@jatinsu
Copy link
Copy Markdown
Contributor Author

jatinsu commented Mar 24, 2026

/retest-required

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Mar 25, 2026

@jatinsu: 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-azure-ovn-upi cd578e8 link false /test e2e-azure-ovn-upi
ci/prow/e2e-vsphere-ovn-upi-zones cd578e8 link false /test e2e-vsphere-ovn-upi-zones
ci/prow/e2e-gcp-ovn-upi cd578e8 link true /test e2e-gcp-ovn-upi

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.

@jatinsu
Copy link
Copy Markdown
Contributor Author

jatinsu commented Mar 26, 2026

Closed as we will be using a rhel9 base image for Upi-installer

@jatinsu jatinsu closed this Mar 26, 2026
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.

3 participants