Skip to content

Commit

Permalink
modify generate script and helm package to use new format
Browse files Browse the repository at this point in the history
  • Loading branch information
mbykhovtsev-ms committed Jan 30, 2025
1 parent 32428ae commit e437525
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 15 deletions.
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"
}
}
7 changes: 5 additions & 2 deletions SPECS/helm/helm.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Name: helm
Version: 3.15.2
Release: 2%{?dist}
Release: 3%{?dist}
Summary: The Kubernetes Package Manager
Group: Applications/Networking
License: Apache 2.0
Expand All @@ -23,7 +23,7 @@ Source0: https://github.com/helm/helm/archive/refs/tags/v%{version}.tar.gz
# --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 +55,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

0 comments on commit e437525

Please sign in to comment.