Skip to content
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

Fixing generate_source_tarball.sh for helm to match other scripts #12143

Open
wants to merge 2 commits into
base: 3.0-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 20 additions & 12 deletions SPECS/helm/generate_source_tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ PKG_VERSION=""
SRC_TARBALL=""
OUT_FOLDER="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# parameters:
#
# --srcTarball : src tarball file
# this file contains the 'initial' source code of the component
# and should be replaced with the new/modified src code
# --outFolder : folder where to copy the new tarball(s)
# --pkgVersion : package version
#
# --srcTarball : src tarball file
# this file contains the 'initial' source code of the component
# and should be replaced with the new/modified src code
# --outFolder : folder where to copy the new tarball(s)
# --pkgVersion : package version
# --vendorVersion : vendor version
PARAMS=""
while (( "$#" )); do
case "$1" in
Expand Down Expand Up @@ -47,6 +45,15 @@ while (( "$#" )); do
exit 1
fi
;;
--vendorVersion)
if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
VENDOR_VERSION=$2
shift 2
else
echo "Error: Argument for $1 is missing" >&2
exit 1
fi
;;
-*|--*=) # unsupported flags
echo "Error: Unsupported flag $1" >&2
exit 1
Expand All @@ -58,9 +65,10 @@ while (( "$#" )); do
esac
done

echo "--srcTarball -> $SRC_TARBALL"
echo "--outFolder -> $OUT_FOLDER"
echo "--pkgVersion -> $PKG_VERSION"
echo "--srcTarball -> $SRC_TARBALL"
echo "--outFolder -> $OUT_FOLDER"
echo "--pkgVersion -> $PKG_VERSION"
echo "--vendorVersion -> $VENDOR_VERSION"

if [ -z "$PKG_VERSION" ]; then
echo "--pkgVersion parameter cannot be empty"
Expand All @@ -79,7 +87,7 @@ pushd $tmpdir > /dev/null

NAME="helm"
NAME_VER="$NAME-$PKG_VERSION"
VENDOR_TARBALL="$OUT_FOLDER/$NAME_VER-vendor.tar.gz"
VENDOR_TARBALL="$OUT_FOLDER/$NAME_VER-govendor-v$VENDOR_VERSION.tar.gz"

echo "Unpacking source tarball..."
tar -xf $SRC_TARBALL
Expand Down
2 changes: 1 addition & 1 deletion SPECS/helm/helm.signatures.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Signatures": {
"helm-3.15.2-vendor.tar.gz": "b7b805732765d0976a0cc9e37ba4ce1c0a92a03c6c6257330ebfd50f860896dc",
"helm-3.15.2-govendor-v1.tar.gz": "b7b805732765d0976a0cc9e37ba4ce1c0a92a03c6c6257330ebfd50f860896dc",
"helm-3.15.2.tar.gz": "c26b74f855cd403183729f24be5a60ed6ed018d2855f0d9caf99cacb127f34b2"
}
}
20 changes: 5 additions & 15 deletions SPECS/helm/helm.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,15 @@

Name: helm
Version: 3.15.2
Release: 2%{?dist}
Release: 3%{?dist}
Summary: The Kubernetes Package Manager
Group: Applications/Networking
License: Apache 2.0
Vendor: Microsoft Corporation
Distribution: Azure Linux
Url: https://helm.sh/
Source0: https://github.com/helm/helm/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
# Below is a manually created tarball, no download link.
# We're using pre-populated Go modules from this tarball, since network is disabled during build time.
# How to re-build this file:
# 1. wget https://github.com/helm/helm/archive/v%%{version}.tar.gz -O %%{name}-%%{version}.tar.gz
# 2. tar -xf %%{name}-%%{version}.tar.gz
# 3. cd %%{name}-%%{version}
# 4. go mod vendor
# 5. tar --sort=name \
# --mtime="2021-04-26 00:00Z" \
# --owner=0 --group=0 --numeric-owner \
# --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime \
# -cf %%{name}-%%{version}-vendor.tar.gz vendor
#
Source1: %{name}-%{version}-vendor.tar.gz
Source1: %{name}-%{version}-govendor-v1.tar.gz
Patch0: CVE-2024-45338.patch
BuildRequires: golang

Expand Down Expand Up @@ -55,6 +42,9 @@ install -m 755 ./helm %{buildroot}%{_bindir}
go test -v ./cmd/helm

%changelog
* Wed Jan 29 2025 Mykhailo Bykhovtsev <[email protected]> - 3.15.2-3
- Change vendor naming convention to match other go packages.

* Tue Dec 31 2024 Rohit Rawat <[email protected]> - 3.15.2-2
- Add patch for CVE-2024-45338

Expand Down
Loading