Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure only test certs are stripped from agent bundle #933

Merged
merged 1 commit into from
Nov 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/otelcol/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ RUN if [ "$ARCH" = "amd64" ]; then \
else \
mkdir -p /usr/lib/splunk-otel-collector/agent-bundle; \
fi
RUN find /usr/lib/splunk-otel-collector/agent-bundle -name "*.key" -delete -or -name "*.pem" -delete
RUN find /usr/lib/splunk-otel-collector/agent-bundle -wholename "*test*.key" -delete -or -wholename "*test*.pem" -delete

FROM scratch
ENV SPLUNK_BUNDLE_DIR=/usr/lib/splunk-otel-collector/agent-bundle
Expand Down
2 changes: 1 addition & 1 deletion cmd/otelcol/Dockerfile.windows
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RUN Remove-Item "SignalFxAgent-win64.zip" -force
RUN Remove-Item "agent-bundle\bin" -force -Recurse
RUN Remove-Item "agent-bundle\etc" -force -Recurse
RUN Get-ChildItem -include __pycache__ -recurse -force | Remove-Item -force -Recurse
RUN Get-ChildItem -recurse -path agent-bundle\* -include *.key,*.pem | Remove-Item -force
RUN Get-ChildItem -recurse -path agent-bundle\* -include *.key,*.pem | Where-Object { $_.Directory -match 'test' } | Remove-Item -force

# Setting environment variables
ENV SPLUNK_BUNDLE_DIR="C:\Program Files\Splunk\OpenTelemetry Collector\agent-bundle"
Expand Down
2 changes: 1 addition & 1 deletion internal/buildscripts/packaging/fpm/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ download_smart_agent() {
mkdir -p "$buildroot/$BUNDLE_BASE_DIR"
tar -xzf "$buildroot/signalfx-agent.tar.gz" -C "$buildroot/$BUNDLE_BASE_DIR"
mv "$buildroot/$BUNDLE_BASE_DIR/signalfx-agent" "$buildroot/$AGENT_BUNDLE_INSTALL_DIR"
find "$buildroot/$AGENT_BUNDLE_INSTALL_DIR" -name "*.key" -delete -or -name "*.pem" -delete
find "$buildroot/$AGENT_BUNDLE_INSTALL_DIR" -wholename "*test*.key" -delete -or -wholename "*test*.pem" -delete
rm -f "$buildroot/$AGENT_BUNDLE_INSTALL_DIR/bin/signalfx-agent"
rm -f "$buildroot/$AGENT_BUNDLE_INSTALL_DIR/bin/agent-status"
rm -f "$buildroot/signalfx-agent.tar.gz"
Expand Down
2 changes: 1 addition & 1 deletion internal/buildscripts/packaging/msi/msi-builder/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ download_and_extract_smart_agent() {
# This defers resolving https://github.com/wixtoolset/issues/issues/5314, which appears to require building on windows.
# Check if test file content's path is >= 126 (128 w/ 'Z:' prefix in wine).
find "$output_dir" -wholename "*/tests/*" -exec bash -c 'if [ `echo "{}" | wc -c` -ge 126 ]; then rm -f {}; fi' \;
find "$output_dir" -name "*.key" -delete -or -name "*.pem" -delete
find "$output_dir" -wholename "*test*.key" -delete -or -wholename "*test*.pem" -delete
rm -f "${build_dir}/signalfx-agent.zip"
}

Expand Down