prometheus-adapter: Adding to core packages (#4867)
This commit is contained in:
Родитель
0e4581a73e
Коммит
10c686d122
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -2155,6 +2155,7 @@
|
|||
"pigz",
|
||||
"prebuilt-ca-certificates",
|
||||
"prebuilt-ca-certificates-base",
|
||||
"prometheus-adapter",
|
||||
"python-cachetools",
|
||||
"python-cherrypy",
|
||||
"python-execnet",
|
||||
|
|
|
@ -0,0 +1,94 @@
|
|||
#!/bin/bash
|
||||
|
||||
# The flow of this script is as such:
|
||||
# 1. Download prometheus-adapter tarball to a temp working directory and extract it.
|
||||
# 2. Then we run go mod vendor.
|
||||
# 3. We tar the updated prometheus-adapter
|
||||
|
||||
set -e
|
||||
|
||||
SRC_TARBALL=""
|
||||
OUT_FOLDER="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
PKG_VERSION=""
|
||||
|
||||
# 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
|
||||
#
|
||||
PARAMS=""
|
||||
while (( "$#" )); do
|
||||
case "$1" in
|
||||
--srcTarball)
|
||||
if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
|
||||
SRC_TARBALL=$2
|
||||
shift 2
|
||||
else
|
||||
echo "Error: Argument for $1 is missing" >&2
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
--outFolder)
|
||||
if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
|
||||
OUT_FOLDER=$2
|
||||
shift 2
|
||||
else
|
||||
echo "Error: Argument for $1 is missing" >&2
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
--pkgVersion)
|
||||
if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
|
||||
PKG_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
|
||||
;;
|
||||
*) # preserve positional arguments
|
||||
PARAMS="$PARAMS $1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo "--srcTarball -> $SRC_TARBALL"
|
||||
echo "--outFolder -> $OUT_FOLDER"
|
||||
echo "--pkgVersion -> $PKG_VERSION"
|
||||
|
||||
if [ -z "$PKG_VERSION" ]; then
|
||||
echo "--pkgVersion parameter cannot be empty"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "-- create temp folder"
|
||||
TEMPDIR=$(mktemp -d)
|
||||
function cleanup {
|
||||
echo "+++ cleanup -> remove $TEMPDIR"
|
||||
rm -rf $TEMPDIR
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
echo "Starting Prometheus-Adapter source tarball creation"
|
||||
ADAPTER_URL="https://github.com/kubernetes-sigs/prometheus-adapter/archive/refs/tags/v$PKG_VERSION.tar.gz"
|
||||
|
||||
cd "$TEMPDIR"
|
||||
# sudo chown -R "$USER": .
|
||||
wget -c $ADAPTER_URL -O "prometheus-adapter-$PKG_VERSION.tar.gz"
|
||||
tar -xzf "prometheus-adapter-$PKG_VERSION.tar.gz"
|
||||
cd "prometheus-adapter-$PKG_VERSION"
|
||||
go mod vendor
|
||||
|
||||
cd "$TEMPDIR"
|
||||
tar -czf "$OUT_FOLDER/prometheus-adapter-$PKG_VERSION.tar.gz" "prometheus-adapter-$PKG_VERSION"
|
||||
cd "$START_DIR"
|
||||
rm -rf "$TEMPDIR"
|
||||
echo "Source tarball $OUT_FOLDER/prometheus-adapter-$PKG_VERSION.tar.gz successfully created!"
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"Signatures": {
|
||||
"prometheus-adapter-0.10.0.tar.gz": "4decc37007e6f894cdc44c698a7b9f293f6b18f3060369a012306954f672021b"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
Summary: Kubernetes Custom, Resource, and External Metric APIs implemented to work with Prometheus.
|
||||
Name: prometheus-adapter
|
||||
Version: 0.10.0
|
||||
Release: 1%{?dist}
|
||||
License: Apache-2.0
|
||||
Vendor: Microsoft Corporation
|
||||
Distribution: Mariner
|
||||
URL: https://github.com/kubernetes-sigs/prometheus-adapter
|
||||
Source0: https://github.com/kubernetes-sigs/%{name}/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
||||
BuildRequires: golang
|
||||
BuildRequires: prometheus
|
||||
|
||||
%description
|
||||
Implementation of Prometheus via Kubernetes Custom, Resource, and External Metric API.
|
||||
|
||||
%prep
|
||||
%autosetup -p1
|
||||
|
||||
%build
|
||||
make prometheus-adapter
|
||||
|
||||
%install
|
||||
install -m 0755 -vd %{buildroot}%{_bindir}
|
||||
install -m 0755 -vp adapter %{buildroot}%{_bindir}/
|
||||
|
||||
%check
|
||||
make test
|
||||
|
||||
%files
|
||||
%license LICENSE NOTICE
|
||||
%doc docs CONTRIBUTING.md OWNERS SECURITY.md SECURITY_CONTACTS VERSION code-of-conduct.md
|
||||
%doc README.md RELEASE.md
|
||||
%{_bindir}/*
|
||||
|
||||
%changelog
|
||||
* Wed Feb 15 2023 Osama Esmail <osamaesmail@microsoft.com> - 0.10.0-1
|
||||
- Original version for CBL-Mariner
|
||||
- License verified.
|
|
@ -20599,6 +20599,16 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"component": {
|
||||
"type": "other",
|
||||
"other": {
|
||||
"name": "prometheus-adapter",
|
||||
"version": "0.10.0",
|
||||
"downloadUrl": "https://github.com/kubernetes-sigs/prometheus-adapter/archive/refs/tags/v0.10.0.tar.gz"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"component": {
|
||||
"type": "other",
|
||||
|
|
Загрузка…
Ссылка в новой задаче