Skip to content

Commit c65ced7

Browse files
author
Pat
authored
install: update to fix AmazonLinux versions (#7354)
Signed-off-by: Patrick Stephens <[email protected]>
1 parent 03c879f commit c65ced7

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

install.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ RELEASE_VERSION=${FLUENT_BIT_RELEASE_VERSION:-}
1111
INSTALL_CMD_PREFIX=${FLUENT_BIT_INSTALL_COMMAND_PREFIX:-}
1212
# Optionally set the name of th package to install, e.g. for legacy td-agent-bit.
1313
INSTALL_PACKAGE_NAME=${FLUENT_BIT_INSTALL_PACKAGE_NAME:-fluent-bit}
14-
# Optional Apt/Yum additional parameters (e.g. releasever for AL2022)
14+
# Optional Apt/Yum additional parameters (e.g. releasever for AL2022/AL2023)
1515
APT_PARAMETERS=${FLUENT_BIT_INSTALL_APT_PARAMETERS:-}
1616
YUM_PARAMETERS=${FLUENT_BIT_INSTALL_YUM_PARAMETERS:-}
1717

@@ -57,26 +57,25 @@ fi
5757
# Will require sudo
5858
case ${OS} in
5959
amzn|amazonlinux)
60-
# We need variable expansion and non-expansion on the URL line to pick up the base URL.
61-
# Therefore we combine things with sed to handle it.
6260
$SUDO sh <<SCRIPT
6361
rpm --import $RELEASE_KEY
6462
cat << EOF > /etc/yum.repos.d/fluent-bit.repo
6563
[fluent-bit]
6664
name = Fluent Bit
6765
# Legacy server style
68-
baseurl = $RELEASE_URL/amazonlinux/VERSION_SUBSTR
66+
baseurl = $RELEASE_URL/amazonlinux/$VERSION
6967
gpgcheck=1
7068
repo_gpgcheck=1
7169
gpgkey=$RELEASE_KEY
7270
enabled=1
7371
EOF
74-
sed -i 's|VERSION_SUBSTR|\$releasever/|g' /etc/yum.repos.d/fluent-bit.repo
7572
cat /etc/yum.repos.d/fluent-bit.repo
7673
$INSTALL_CMD_PREFIX yum -y $YUM_PARAMETERS install $INSTALL_PACKAGE_NAME$YUM_VERSION
7774
SCRIPT
7875
;;
7976
centos|centoslinux|rhel|redhatenterpriselinuxserver|fedora|rocky|almalinux)
77+
# We need variable expansion and non-expansion on the URL line to pick up the base URL.
78+
# Therefore we combine things with sed to handle it.
8079
$SUDO sh <<SCRIPT
8180
rpm --import $RELEASE_KEY
8281
cat << EOF > /etc/yum.repos.d/fluent-bit.repo

packaging/test-release-packages.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,13 @@ do
5353
echo "Testing $IMAGE"
5454
LOG_FILE=$(mktemp)
5555

56-
UPDATED_FLUENT_BIT_INSTALL_COMMAND_PREFIX=${FLUENT_BIT_INSTALL_COMMAND_PREFIX:-}
57-
# For AL2023 we currently want a fixed 2023 version instead of build timestamps
58-
if [[ "$IMAGE" == "amazonlinux:2023" ]]; then
59-
UPDATED_FLUENT_BIT_INSTALL_COMMAND_PREFIX="sed -i 's|\$releasever/|2023/|g' /etc/yum.repos.d/fluent-bit.repo;${FLUENT_BIT_INSTALL_COMMAND_PREFIX:-}"
60-
fi
61-
6256
# We do want word splitting for EXTRA_MOUNTS
6357
# shellcheck disable=SC2086
6458
$CONTAINER_RUNTIME run --rm -t \
6559
-e FLUENT_BIT_PACKAGES_URL="${FLUENT_BIT_PACKAGES_URL:-https://packages.fluentbit.io}" \
6660
-e FLUENT_BIT_PACKAGES_KEY="${FLUENT_BIT_PACKAGES_KEY:-https://packages.fluentbit.io/fluentbit.key}" \
6761
-e FLUENT_BIT_RELEASE_VERSION="${FLUENT_BIT_RELEASE_VERSION:-}" \
68-
-e FLUENT_BIT_INSTALL_COMMAND_PREFIX="$UPDATED_FLUENT_BIT_INSTALL_COMMAND_PREFIX" \
62+
-e FLUENT_BIT_INSTALL_COMMAND_PREFIX="${FLUENT_BIT_INSTALL_COMMAND_PREFIX:-}" \
6963
-e FLUENT_BIT_INSTALL_PACKAGE_NAME="${FLUENT_BIT_INSTALL_PACKAGE_NAME:-fluent-bit}" \
7064
-e FLUENT_BIT_INSTALL_YUM_PARAMETERS="${FLUENT_BIT_INSTALL_YUM_PARAMETERS:-}" \
7165
$EXTRA_MOUNTS \

0 commit comments

Comments
 (0)