Skip to content

Commit b2ab014

Browse files
Ensure only test certs are stripped from agent bundle (#933)
1 parent 755bee9 commit b2ab014

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

cmd/otelcol/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ RUN if [ "$ARCH" = "amd64" ]; then \
3535
else \
3636
mkdir -p /usr/lib/splunk-otel-collector/agent-bundle; \
3737
fi
38-
RUN find /usr/lib/splunk-otel-collector/agent-bundle -name "*.key" -delete -or -name "*.pem" -delete
38+
RUN find /usr/lib/splunk-otel-collector/agent-bundle -wholename "*test*.key" -delete -or -wholename "*test*.pem" -delete
3939

4040
FROM scratch
4141
ENV SPLUNK_BUNDLE_DIR=/usr/lib/splunk-otel-collector/agent-bundle

cmd/otelcol/Dockerfile.windows

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ RUN Remove-Item "SignalFxAgent-win64.zip" -force
3131
RUN Remove-Item "agent-bundle\bin" -force -Recurse
3232
RUN Remove-Item "agent-bundle\etc" -force -Recurse
3333
RUN Get-ChildItem -include __pycache__ -recurse -force | Remove-Item -force -Recurse
34-
RUN Get-ChildItem -recurse -path agent-bundle\* -include *.key,*.pem | Remove-Item -force
34+
RUN Get-ChildItem -recurse -path agent-bundle\* -include *.key,*.pem | Where-Object { $_.Directory -match 'test' } | Remove-Item -force
3535

3636
# Setting environment variables
3737
ENV SPLUNK_BUNDLE_DIR="C:\Program Files\Splunk\OpenTelemetry Collector\agent-bundle"

internal/buildscripts/packaging/fpm/common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ download_smart_agent() {
9494
mkdir -p "$buildroot/$BUNDLE_BASE_DIR"
9595
tar -xzf "$buildroot/signalfx-agent.tar.gz" -C "$buildroot/$BUNDLE_BASE_DIR"
9696
mv "$buildroot/$BUNDLE_BASE_DIR/signalfx-agent" "$buildroot/$AGENT_BUNDLE_INSTALL_DIR"
97-
find "$buildroot/$AGENT_BUNDLE_INSTALL_DIR" -name "*.key" -delete -or -name "*.pem" -delete
97+
find "$buildroot/$AGENT_BUNDLE_INSTALL_DIR" -wholename "*test*.key" -delete -or -wholename "*test*.pem" -delete
9898
rm -f "$buildroot/$AGENT_BUNDLE_INSTALL_DIR/bin/signalfx-agent"
9999
rm -f "$buildroot/$AGENT_BUNDLE_INSTALL_DIR/bin/agent-status"
100100
rm -f "$buildroot/signalfx-agent.tar.gz"

internal/buildscripts/packaging/msi/msi-builder/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ download_and_extract_smart_agent() {
212212
# This defers resolving https://github.com/wixtoolset/issues/issues/5314, which appears to require building on windows.
213213
# Check if test file content's path is >= 126 (128 w/ 'Z:' prefix in wine).
214214
find "$output_dir" -wholename "*/tests/*" -exec bash -c 'if [ `echo "{}" | wc -c` -ge 126 ]; then rm -f {}; fi' \;
215-
find "$output_dir" -name "*.key" -delete -or -name "*.pem" -delete
215+
find "$output_dir" -wholename "*test*.key" -delete -or -wholename "*test*.pem" -delete
216216
rm -f "${build_dir}/signalfx-agent.zip"
217217
}
218218

0 commit comments

Comments
 (0)