From 18eb00769e7a76b07608bd9d7870d0f40210a449 Mon Sep 17 00:00:00 2001 From: Bitnami Bot Date: Tue, 4 Feb 2020 13:45:58 +0000 Subject: [PATCH] 7.5.2-debian-10-r10 release --- bitnami/logstash/7/debian-10/Dockerfile | 4 +- .../7/debian-10/prebuildfs/libfile.sh | 52 ++++++++++++++++--- bitnami/logstash/README.md | 2 +- 3 files changed, 48 insertions(+), 10 deletions(-) diff --git a/bitnami/logstash/7/debian-10/Dockerfile b/bitnami/logstash/7/debian-10/Dockerfile index 95d60bd33b39..290268ed0590 100644 --- a/bitnami/logstash/7/debian-10/Dockerfile +++ b/bitnami/logstash/7/debian-10/Dockerfile @@ -9,7 +9,7 @@ ENV HOME="/" \ COPY prebuildfs / # Install required system packages and dependencies RUN install_packages ca-certificates curl libc6 libgcc1 procps sudo unzip zlib1g -RUN . ./libcomponent.sh && component_unpack "logstash" "7.5.2-0" --checksum 34be4d129d53b8388a710298e70879beba1b98b491aa7698981ab0a32e95c59d +RUN . ./libcomponent.sh && component_unpack "logstash" "7.5.2-1" --checksum 86003a5b88fa47ab8c6e27284c59467ed904641c2218316a7a818442d624ae36 RUN . ./libcomponent.sh && component_unpack "java" "1.8.242-0" --checksum 3a70f3d1c3cd9bc6ec581b2a10373a2b323c0b9af40402ce8d19aeb0b3d02400 RUN apt-get update && apt-get upgrade && \ rm -r /var/lib/apt/lists /var/cache/apt/archives @@ -18,7 +18,7 @@ RUN /build/install-gosu.sh COPY rootfs / RUN /postunpack.sh ENV BITNAMI_APP_NAME="logstash" \ - BITNAMI_IMAGE_VERSION="7.5.2-debian-10-r9" \ + BITNAMI_IMAGE_VERSION="7.5.2-debian-10-r10" \ PATH="/opt/bitnami/logstash/bin:/opt/bitnami/java/bin:$PATH" EXPOSE 8080 diff --git a/bitnami/logstash/7/debian-10/prebuildfs/libfile.sh b/bitnami/logstash/7/debian-10/prebuildfs/libfile.sh index 12010f043e49..337e2e779701 100644 --- a/bitnami/logstash/7/debian-10/prebuildfs/libfile.sh +++ b/bitnami/logstash/7/debian-10/prebuildfs/libfile.sh @@ -5,18 +5,56 @@ # Functions ######################## -# Ensure a line exists in the file by replacing a matching line. +# Replace a regex in a file # Arguments: # $1 - filename -# $2 - line -# $3 - match +# $2 - match regex +# $3 - substitute regex +# $4 - use POSIX regex. Default: true # Returns: # None ######################### -file_contains_line() { +replace_in_file() { local filename="${1:?filename is required}" - local line="${2:?line is required}" - local match="${3:?match is required}" + local match_regex="${2:?match regex is required}" + local substitute_regex="${3:?substitute regex is required}" + local posix_regex=${4:-true} - sed --in-place "s/^$match\$/$line/" "$filename" + local result + + # We should avoid using 'sed in-place' substitutions + # 1) They are not compatible with files mounted from ConfigMap(s) + # 2) We found incompatibility issues with Debian10 and "in-place" substitutions + if [[ $posix_regex = true ]]; then + result="$(sed -E "s@$match_regex@$substitute_regex@g" "$filename")" + else + result="$(sed "s@$match_regex@$substitute_regex@g" "$filename")" + fi + echo "$result" > "$filename" +} + +######################## +# Remove a line in a file based on a regex +# Arguments: +# $1 - filename +# $2 - match regex +# $3 - use POSIX regex. Default: true +# Returns: +# None +######################### +remove_in_file() { + local filename="${1:?filename is required}" + local match_regex="${2:?match regex is required}" + local posix_regex=${3:-true} + local result + + # We should avoid using 'sed in-place' substitutions + # 1) They are not compatible with files mounted from ConfigMap(s) + # 2) We found incompatibility issues with Debian10 and "in-place" substitutions + if [[ $posix_regex = true ]]; then + result="$(sed -E "/$match_regex/d" "$filename")" + else + result="$(sed "/$match_regex/d" "$filename")" + fi + echo "$result" > "$filename" } diff --git a/bitnami/logstash/README.md b/bitnami/logstash/README.md index 001bc49862e1..783f5d0d10e6 100644 --- a/bitnami/logstash/README.md +++ b/bitnami/logstash/README.md @@ -45,7 +45,7 @@ Learn more about the Bitnami tagging policy and the difference between rolling t * [`7-ol-7`, `7.5.2-ol-7-r12` (7/ol-7/Dockerfile)](https://github.com/bitnami/bitnami-docker-logstash/blob/7.5.2-ol-7-r12/7/ol-7/Dockerfile) -* [`7-debian-10`, `7.5.2-debian-10-r9`, `7`, `7.5.2`, `latest` (7/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-logstash/blob/7.5.2-debian-10-r9/7/debian-10/Dockerfile) +* [`7-debian-10`, `7.5.2-debian-10-r10`, `7`, `7.5.2`, `latest` (7/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-logstash/blob/7.5.2-debian-10-r10/7/debian-10/Dockerfile) Subscribe to project updates by watching the [bitnami/logstash GitHub repo](https://github.com/bitnami/bitnami-docker-logstash).