-
Notifications
You must be signed in to change notification settings - Fork 448
OCPBUGS-57473: extract oc binary instead of pulling OS image #5313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
OCPBUGS-57473: extract oc binary instead of pulling OS image #5313
Conversation
Skipping CI for Draft Pull Request. |
@cheesesashimi: This pull request references Jira Issue OCPBUGS-57473, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. In response to this:
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. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cheesesashimi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
a62e581
to
8e9db7c
Compare
@cheesesashimi: The following tests failed, say
Full PR test history. Your PR dashboard. 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me and I see that the updated unit tests are still passing, but I'll leave final tagging to a team MCO engineer with more context.
/jira refresh |
@cheesesashimi: This pull request references Jira Issue OCPBUGS-57473, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
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. |
- What I did
The first-pass of OCL made use of the fact that the OS image has the
oc
binary so that we would always have the most appropriate version of the binary for a given OpenShift release. Unfortunately, this has the following side effects:There are two paths forward to mitigate this:
openshift-clients
package into the MCO image.oc
binary from the base OS image after we've used it.For 4.19 and 4.20, we can use the first approach. For 4.18, we must use the latter approach. Here's why:
dnf install openshift-clients
. It does not work correctly in the base image we use in 4.18 (registry.ci.openshift.org/ocp/builder:rhel-9-enterprise-base-multi-openshift-4.18
) or 4.19 (registry.ci.openshift.org/ocp/builder:rhel-9-enterprise-base-multi-openshift-4.18
).registry.ci.openshift.org/ocp/4.19:base-rhel9
andregistry.ci.openshift.org/ocp/4.20:base-rhel9
are manifestlisted and have multi-arch support. Unfortunately, the 4.18 version of this image does not. That said, I have added some conditional logic to handle this case better.So what we do now is install the
oc
binary in the container image where / when possible. We check if the binary is present and if not, we extract it from the base OS image after the build is complete. Otherwise, we use theoc
binary as-is if it is indeed present.- How to verify it
$ oc get configmap/machine-config-osimageurl -n openshift-machine-config-operator -o json | jq -r '.data.baseOSContainerImage'
crictl images -o json | grep "<base os image pullspec>"
. The base OS image should not be found in CRI-O's container image storage.It is worth noting that the reason why the image should not be found there is because the Buildah pod cannot touch the host's container image storage.
- Description for the changelog
Extract
oc
binary after OCL build