Skip to content

Commit 4791d9c

Browse files
fix coralogix-otel-collector.sh failure
1 parent fe2e2c4 commit 4791d9c

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

otel-collector-windows-image/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ FROM ${WIN_BASE_IMAGE}
1313

1414
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
1515

16+
# hadolint ignore=DL3045
1617
COPY --from=build /src/otelcol-contrib.exe ./
18+
# hadolint ignore=DL3045
1719
COPY configs/otelcol-contrib.yaml config.yaml
1820

1921
ENV NO_WINDOWS_SERVICE=1

otel-installer/standalone/coralogix-otel-collector.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ USER_SET_MEMORY_LIMIT=false
7878
USER_SET_LISTEN_INTERFACE=false
7979
ENABLE_CAPABILITIES=false
8080
DISABLE_CAPABILITIES_FLAG=false
81+
INSTALL_WORKDIR=""
8182

8283
if [ "$UID" = "0" ] || [ "$(id -u)" -eq 0 ]; then
8384
SUDO_CMD=""
@@ -114,6 +115,12 @@ fail() {
114115
error "$@"
115116
}
116117

118+
cleanup_workdir() {
119+
if [ -n "${INSTALL_WORKDIR:-}" ] && [ -d "$INSTALL_WORKDIR" ]; then
120+
rm -rf "$INSTALL_WORKDIR"
121+
fi
122+
}
123+
117124
check_port() {
118125
local port="$1"
119126
local name="$2"
@@ -1985,7 +1992,8 @@ main() {
19851992
timestamp=$(get_timestamp)
19861993
workdir="/tmp/${SERVICE_NAME}-install-${timestamp}-$$"
19871994
mkdir -p "$workdir"
1988-
trap 'rm -rf "$workdir"' EXIT INT TERM HUP
1995+
INSTALL_WORKDIR="$workdir"
1996+
trap cleanup_workdir EXIT INT TERM HUP
19891997
cd "$workdir"
19901998

19911999
os=$(detect_os)

0 commit comments

Comments
 (0)