Skip to content

Commit

Permalink
Merge pull request #112 from vrutkovs/4.7-no-xattrs
Browse files Browse the repository at this point in the history
[release-4.7] Strip xattrs
  • Loading branch information
openshift-merge-robot committed Mar 29, 2021
2 parents b632cfe + b120ee9 commit 570737f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
@@ -1,7 +1,7 @@
FROM quay.io/openshift/origin-machine-config-operator:4.7 as mcd
FROM quay.io/openshift/origin-artifacts:4.7 as artifacts

FROM quay.io/coreos-assembler/coreos-assembler:v0.10.0 AS build
FROM quay.io/coreos-assembler/coreos-assembler:latest AS build
COPY --from=mcd /usr/bin/machine-config-daemon /srv/addons/usr/libexec/machine-config-daemon
COPY --from=artifacts /srv/repo/*.rpm /tmp/rpms/
USER 0
Expand Down
17 changes: 17 additions & 0 deletions entrypoint.sh
Expand Up @@ -124,6 +124,15 @@ mkdir /extensions
pushd /extensions
mkdir okd
yumdownloader ${YUMD_PARAMS} --destdir=/extensions/okd ${EXTENSION_RPMS[*]}
# Strip problematic xattrs from extension RPMs
for i in $(find /extensions/okd -iname *.rpm); do
fattr=$(getfattr -m 'user.*' $i)
if [ -n "$fattr" ]; then
attr=$(echo "$fattr" | grep -Ee '^user')
setfattr -x "${attr}" $i
fi
done

createrepo_c --no-database .
popd

Expand All @@ -137,6 +146,14 @@ yumdownloader ${YUMD_PARAMS} --destdir=/tmp/rpms --enablerepo=updates-testing-mo
# inject MCD binary and cri-o, hyperkube, and bootstrap RPMs in the ostree commit
mkdir /tmp/working
pushd /tmp/working
# Strip problematic xattrs from extension RPMs
for i in $(find /tmp/rpms -iname *.rpm); do
fattr=$(getfattr -m 'user.*' $i)
if [ -n "$fattr" ]; then
attr=$(echo "$fattr" | grep -Ee '^user')
setfattr -x "${attr}" $i
fi
done
for i in $(find /tmp/rpms/ -iname *.rpm); do
echo "Extracting $i ..."
rpm2cpio $i | cpio -div
Expand Down

0 comments on commit 570737f

Please sign in to comment.