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
OCPBUGS-25461: Add RHEL9 and RHEL8 based oc as new targets in command extraction #1647
OCPBUGS-25461: Add RHEL9 and RHEL8 based oc as new targets in command extraction #1647
Conversation
@ardaguclu: This pull request references Jira Issue OCPBUGS-25461, 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. |
/jira refresh |
@ardaguclu: This pull request references Jira Issue OCPBUGS-25461, 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. |
@ingvagabund Does this patch make sense under the light of our discussions?.
|
ee53281
to
f1cac6d
Compare
Was this bug introduced with rhel8/rhel9 change? Or, has it been around for some time already? |
OS: "linux", | ||
Arch: "amd64", | ||
Command: "oc.rhel8", | ||
Mapping: extract.Mapping{Image: "cli-artifacts", From: "usr/share/openshift/linux_amd64/oc.rhel8"}, |
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.
How's the symlink processing implemented here? Will the extracted binary be a symlink or the symlink target?
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.
Will the final binary be oc or oc.rhel8? I prefer oc only.
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.
Thanks a lot for review.
How's the symlink processing implemented here? Will the extracted binary be a symlink or the symlink target?
For which symlink are you asking oc -> kubectl or oc -> oc.rhel8?. If it is for oc -> oc.rhel8, it is the same principle of
oc/images/cli-artifacts/Dockerfile.rhel
Line 18 in f1cac6d
ln -sf /usr/share/openshift/linux_$(uname -m | sed 's/aarch64/arm64/;s/x86_64/amd64/')/oc /usr/bin/oc && \ |
oc/pkg/cli/admin/release/extract_tools.go
Lines 257 to 267 in f1cac6d
{ | |
OS: "linux", | |
Arch: "amd64", | |
Command: "oc", | |
Mapping: extract.Mapping{Image: "cli-artifacts", From: "usr/share/openshift/linux_amd64/oc"}, | |
LinkTo: []string{"kubectl"}, | |
Readme: readmeCLIUnix, | |
InjectReleaseVersion: true, | |
ArchiveFormat: "openshift-client-linux-amd64-%s.tar.gz", | |
}, |
Will the final binary be oc or oc.rhel8? I prefer oc only.
Good point and it would be nicer, I can change them to oc
.
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.
@ingvagabund I've added new optional TargetCommandName field to rename extracted binaries.
@@ -18,6 +18,10 @@ RUN cd /usr/share/openshift && \ | |||
ln -sf /usr/share/openshift/linux_$(uname -m | sed 's/aarch64/arm64/;s/x86_64/amd64/')/oc /usr/bin/oc && \ | |||
mv windows_amd64 windows && mv darwin_amd64 mac && mv darwin_arm64 mac_arm64 | |||
|
|||
RUN ln -sf /usr/share/openshift/linux_amd64/oc /usr/share/openshift/linux_amd64/oc.rhel8 | |||
RUN ln -sf /usr/share/openshift/linux_arm64/oc /usr/share/openshift/linux_arm64/oc.rhel8 | |||
RUN ln -sf /usr/share/openshift/linux_ppc64le/oc /usr/share/openshift/linux_ppc64le/oc.rhel8 |
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.
Is there any extract target for ppc64le?
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.
No, I added it just to support when/if there is a demand to extract oc in ppc64le arch type but I can remove, if it creates confusion.
klog.V(2).Infof("Skipping duplicate %s", target.ArchiveFormat) | ||
continue | ||
if _, ok := targetArchCommands[target.Command]; ok { | ||
// Some target commands have release-arch types that defines extracting |
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.
Was this corner case introduced with rhel8/rhel9 change? Or, has it been around for some time already?
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.
It has existed for a long time (from this commit 3dba61a), but it didn't cause any problem because all the targets have release-arch
type until now. oc.rhel9 and oc.rhel8 have their own static arch types.
795a39a
to
7010159
Compare
/lgtm |
/hold |
@ardaguclu: This pull request references Jira Issue OCPBUGS-25461, which is valid. 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. |
/retest |
Last commit is just for backwards compatibility purposes and unlikely to affect the results of CI jobs; /retest |
/retest |
/label qe-approved |
@ingvagabund could you please have a look at?. Thanks. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ardaguclu, ingvagabund 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 |
Since the pre-merge tests have been completed and no issues found; |
@ardaguclu: all tests passed! 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/test-infra repository. I understand the commands that are listed here. |
@ardaguclu: Jira Issue OCPBUGS-25461: All pull requests linked via external trackers have merged: Jira Issue OCPBUGS-25461 has been moved to the MODIFIED state. 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. |
/cherry-pick release-4.15 |
@soltysh: #1647 failed to apply on top of branch "release-4.15":
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 kubernetes/test-infra repository. |
As explained in the referenced bug, oc compiled in RHEL8 does not work
on FIPS enabled RHEL9 environment. However, we need to provide a way to
users to enable extraction of oc compiled in RHEL9 to work on FIPS enabled clusters.
This PR adds new command targets in
oc adm release extract
command thatusers can extract oc specific to their RHEL versions as a continuation of
#1632
Single command extraction
All tools extraction
$ ./oc adm release extract registry.ci.openshift.org/ocp/release:4.16.0-0.nightly-2024-01-03-193825 --to=/tmp/test_extract --tools ccoctl-linux-4.16.0-0.nightly-2024-01-03-193825.tar.gz openshift-client-linux-4.16.0-0.nightly-2024-01-03-193825.tar.gz openshift-client-linux-amd64-rhel9-4.16.0-0.nightly-2024-01-03-193825.tar.gz # There should also be openshift-client-linux-amd64-rhel8-4.16.0-0.nightly-2024-01-03-193825.tar.gz but we haven't added that yet openshift-install-linux-4.16.0-0.nightly-2024-01-03-193825.tar.gz
All tools extraction in specific os/arch
$ ./oc adm release extract registry.ci.openshift.org/ocp/release:4.16.0-0.nightly-2024-01-03-193825 --to=/tmp/test_extract_arm64 --tools --command-os=linux/arm64 openshift-client-linux-arm64-4.16.0-0.nightly-2024-01-03-193825.tar.gz openshift-client-linux-arm64-rhel9-4.16.0-0.nightly-2024-01-03-193825.tar.gz # There should also be openshift-client-linux-arm64-rhel8-4.16.0-0.nightly-2024-01-03-193825.tar.gz but we haven't added that yet openshift-install-linux-arm64-4.16.0-0.nightly-2024-01-03-193825.tar.gz
These new targets will stay until the fully migration to RHEL9 is completed and we'll return back to defaults.