-
Notifications
You must be signed in to change notification settings - Fork 505
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
use fedora:36 for RPM builds #2910
use fedora:36 for RPM builds #2910
Conversation
fixes the RPM digest algorithm to allow installation on FIPS-enabled operating systems Signed-off-by: Aron Parsons <[email protected]>
Welcome @knackaron! |
Hi @knackaron. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/release-note-none |
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.
@kubernetes/release-managers PTAL
/hold
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: knackaron, saschagrunert 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 |
/ok-to-test |
@@ -42,7 +42,7 @@ for ARCH in ${ARCHS[@]}; do | |||
sed -i "s/\%global ARCH.*/\%global ARCH ${GOARCH}/" ${SRC_PATH}/kubelet.spec | |||
# Download sources if not already available | |||
cd ${SRC_PATH} && spectool -gf kubelet.spec | |||
/usr/bin/rpmbuild --target ${RPMARCH} --define "_sourcedir ${SRC_PATH}" -bb ${SRC_PATH}/kubelet.spec | |||
/usr/bin/rpmbuild --target ${RPMARCH} --define "_sourcedir ${SRC_PATH}" --define "_smp_build_ncpus 1" --define "__os_install_post %{nil}" -bb ${SRC_PATH}/kubelet.spec |
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.
Why these extra defines? The commit message doesn't clarify.
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.
They were the most pragmatic solution to issues encountered with some of the cross-compilation targets.
Disabling __os_install_post
is to stop the standard macros rpmbuild uses from stripping the binaries. Stripping is fine on x86_64, but not on ARM targets (since their cross-compilation tools aren't installed):
+ /usr/lib/rpm/brp-strip /usr/bin/strip
/usr/bin/strip: Unable to recognise the format of the input file `/root/rpmbuild/BUILDROOT/kubelet-1.19.0-0.%{_arch}/usr/bin/crictl'
/usr/bin/strip: Unable to recognise the format of the input file `/root/rpmbuild/BUILDROOT/kubelet-1.19.0-0.%{_arch}/opt/cni/bin/bridge'
If deemed important, I can work in the logic to install the correct cross-compiler binutils packages per arch and override per build target. The patch gets a little larger at that point.
Setting _smp_build_ncpus
is to work around a dependency issue. This macro is defined by build-constraints-rpm-macros
, which has a conflict with redhat-rpm-macros
:
Error: Transaction test error:
file /usr/lib/rpm/macros.d/macros.build-constraints from install of build-constraints-rpm-macros-1-2.fc36.noarch conflicts with file from package redhat-rpm-config-222-1.fc36.noarch
Not defining _smp_build_ncpus
results in:
+ /usr/lib/rpm/check-rpaths
xargs: invalid number "%{_smp_build_ncpus}" for -P option
Try 'xargs --help' for more information.
error: Bad exit status from /var/tmp/rpm-tmp.jLaICn (%install)
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
Obsolete with #3265 |
This addresses the file digest algorithm changing to SHA256 in RPM 4.14, which
was first included in Fedora 27 [1]. A few different sources outline the
details, see [2] and [3]. These digests must be included in the RPMs to be
installed on FIPS-enabled systems, as typically required by US government
organizations.
The Kubernetes RPMs are still being built with a Fedora 24 image, which doesn't
support the SHA256 algorithm. It's a pretty trivial change to swap the container
image used for building the RPMs, since the RPMs are just consuming the already
published binary artifacts from elsewhere.
Note, this does not have anything to do with package signatures or trying to
make the code FIPS-compliant. This is solely addressing the issue of
installing the binary RPMs onto FIPS-enabled systems without having to alter
anything at the system-level. This includes just the kubectl RPM on client
systems.
I also noted that there was effort to modernize the RPM package building
process in #1027, but that effort
seems to have stalled?
built with fedora:24
built with fedora:36
[1] - https://fedoraproject.org/wiki/Changes/RPM-4.14
[2] - https://www.starlab.io/blog/adding-sha256-digests-to-rpms
[3] - https://bugzilla.cendio.com/show_bug.cgi?id=7809#c2
/kind bug