Skip to content

Commit

Permalink
[kube-prometheus-stack] do not use xz
Browse files Browse the repository at this point in the history
Signed-off-by: Jan-Otto Kröpke <[email protected]>
  • Loading branch information
jkroepke committed Jan 15, 2025
1 parent 72562f9 commit 05bb2ce
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 15 deletions.
Binary file not shown.
3 changes: 3 additions & 0 deletions charts/kube-prometheus-stack/ci/06-upgrade-crds-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
crds:
upgradeJob:
enabled: true
16 changes: 16 additions & 0 deletions charts/kube-prometheus-stack/ci/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,27 @@ set -euo pipefail
echo "Please run ./hack/update_crds.sh"

echo "Diff:"
ls -l /tmp/crds.tar.xz charts/crds/files/crds.tar.xz
echo "Diff:"
shasum -a 256 /tmp/crds.tar.xz charts/crds/files/crds.tar.xz
echo "Diff:"
tar tvf /tmp/crds.tar.xz
echo "-----"
tar tvf charts/crds/files/crds.tar.xz
echo "Diff:"

git diff --color=always <(
strings /tmp/crds.tar.xz
) <(
strings charts/crds/files/crds.tar.xz
)
echo "Diff:"

git diff --color=always <(
xxd /tmp/crds.tar.xz
) <(
xxd charts/crds/files/crds.tar.xz
)

exit 1
fi
Expand Down
32 changes: 17 additions & 15 deletions charts/kube-prometheus-stack/hack/update_crds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,25 @@ for line in "${FILES[@]}"; do
fi
done

_TAR=$(which gtar 2>/dev/null || which tar 2>/dev/null)
_TAR=$(which gtar 2>/dev/null)

cd "${SCRIPT_DIR}/../charts/crds/crds/"

case $($_TAR --help) in
*GNU*) ;;
*GNU*)
find crd-*.yaml -print0 | sort -z | env COPYFILE_DISABLE=1 ZSTD_CLEVEL=19 $_TAR --sort=name --format=ustar \
--mtime="@0" \
--numeric-owner --owner=0 --group=0 \
--mode='go+u,go-w' \
--no-xattrs --no-acls --no-selinux \
-I zstd -cpf ../files/crds.tar.zst crd-*.yaml
;;
*)
echo "Please install GNU tar"
echo "On macOS: brew install gnu-tar"
exit 1
find crd-*.yaml -print0 -exec touch -t 197001010000 {} + | sort -z | env COPYFILE_DISABLE=1 ZSTD_CLEVEL=19 $_TAR --format=ustar \
--numeric-owner --uid=0 --gid=0 \
--no-xattrs \
--no-recursion --null --files-from - \
--options zstd:compression-level=19 \
--zstd -cf ../files/crds.tar.zst
;;
esac

cd "${SCRIPT_DIR}/../charts/crds/crds/"

$_TAR --sort=name --format=posix \
--pax-option='exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime,delete=btime,delete=mtime' \
--mtime="@0" \
--numeric-owner --owner=0 --group=0 \
--mode='go+u,go-w' \
--no-xattrs --no-acls --no-selinux \
--xz -cf ../files/crds.tar.xz crd-*.yaml

0 comments on commit 05bb2ce

Please sign in to comment.