Skip to content

Commit 8ff9569

Browse files
authored
Merge branch 'main' into fluentd_dep_docs
2 parents f9f8307 + 725fa07 commit 8ff9569

27 files changed

+220
-70
lines changed

.github/actionlint.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Configuration related to self-hosted runner.
2+
self-hosted-runner:
3+
# Labels of self-hosted runner in array of strings.
4+
labels:
5+
- otel-arm64
6+
- otel-windows
7+
8+
# Path-specific configurations.
9+
paths:
10+
# Configs are meant to be workflow helpers, not valid GitHub actions. Ignore all errors
11+
# from these files.
12+
.github/workflows/configs/**:
13+
ignore:
14+
- '.*'
15+
16+
# Ignore these notifications/errors for all workflows
17+
.github/workflows/*.{yml,yaml}:
18+
ignore:
19+
- 'index access of array must be type of number but.*' # Caused by taking advantage of GitHub's automatic conversion of bools to integers in for array indexing
20+
21+
# All Windows Paths should ignore errors related to PowerShell formatting.
22+
# Linter shellcheck is not supported for PowerShell
23+
.github/workflows/**/*win*.{yml,yaml}:
24+
ignore:
25+
- 'shellcheck reported issue in this script: SC1001:.+'
26+
- 'shellcheck reported issue in this script: SC1009:.+'
27+
- 'shellcheck reported issue in this script: SC1012:.+'
28+
- 'shellcheck reported issue in this script: SC1050:.+'
29+
- 'shellcheck reported issue in this script: SC1070:.+'
30+
- 'shellcheck reported issue in this script: SC1072:.+'
31+
- 'shellcheck reported issue in this script: SC1073:.+'
32+
- 'shellcheck reported issue in this script: SC1087:.+'
33+
- 'shellcheck reported issue in this script: SC1133:.+'
34+
- 'shellcheck reported issue in this script: SC2006:.+'
35+
- 'shellcheck reported issue in this script: SC2046:.+'
36+
- 'shellcheck reported issue in this script: SC2086:.+'
37+
- 'shellcheck reported issue in this script: SC2283:.+'
38+
39+
# PowerShell lint messages need to be ignored
40+
.github/workflows/**/*msi*.{yml,yaml}:
41+
ignore:
42+
- 'shellcheck reported issue in this script: SC1001:.+'
43+
- 'shellcheck reported issue in this script: SC1009:.+'
44+
- 'shellcheck reported issue in this script: SC1012:.+'
45+
- 'shellcheck reported issue in this script: SC1050:.+'
46+
- 'shellcheck reported issue in this script: SC1070:.+'
47+
- 'shellcheck reported issue in this script: SC1072:.+'
48+
- 'shellcheck reported issue in this script: SC1073:.+'
49+
- 'shellcheck reported issue in this script: SC1087:.+'
50+
- 'shellcheck reported issue in this script: SC1133:.+'
51+
- 'shellcheck reported issue in this script: SC2006:.+'
52+
- 'shellcheck reported issue in this script: SC2046:.+'
53+
- 'shellcheck reported issue in this script: SC2086:.+'
54+
- 'shellcheck reported issue in this script: SC2283:.+'
55+
56+
# PowerShell lint messages need to be ignored
57+
.github/workflows/chef-test.yml:
58+
ignore:
59+
- 'shellcheck reported issue in this script: SC1081:.+'
60+
- 'shellcheck reported issue in this script: SC2086:.+'
61+
62+
# PowerShell lint messages need to be ignored
63+
64+
.github/workflows/puppet-test.yml:
65+
ignore:
66+
- 'shellcheck reported issue in this script: SC1050:.+'
67+
- 'shellcheck reported issue in this script: SC1072:.+'
68+
- 'shellcheck reported issue in this script: SC1073:.+'
69+
70+
# PowerShell lint messages need to be ignored
71+
.github/workflows/vuln-scans.yml:
72+
ignore:
73+
- 'shellcheck reported issue in this script: SC1050:.+'
74+
- 'shellcheck reported issue in this script: SC1072:.+'
75+
- 'shellcheck reported issue in this script: SC1073:.+'

.github/workflows/ansible.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ jobs:
165165
# workaround for https://github.com/yaml/pyyaml/issues/724
166166
pip3 install 'wheel==0.40.0'
167167
pip3 install 'Cython<3.0' 'PyYaml~=5.0' --no-build-isolation
168-
pip3 install --use-pep517 -r ${GITHUB_WORKSPACE}/requirements.txt
168+
pip3 install --use-pep517 -r "${GITHUB_WORKSPACE}/requirements.txt"
169169
170170
- name: Run Molecule tests.
171171
run: molecule --debug -v --base-config ./molecule/config/docker.yml test --all
@@ -240,16 +240,16 @@ jobs:
240240
cache-dependency-path: "${{ github.workspace }}/requirements.txt"
241241

242242
- name: Install test dependencies.
243-
run: pip3 install --use-pep517 -r ${GITHUB_WORKSPACE}/requirements.txt
243+
run: pip3 install --use-pep517 -r "${GITHUB_WORKSPACE}/requirements.txt"
244244

245245
- name: Download vagrant box
246246
run: |
247247
box=$( yq ".platforms[] | select(.name == \"${{ matrix.distro }}\") | .box" ./molecule/config/windows.yml )
248248
box_version=$( yq ".platforms[] | select(.name == \"${{ matrix.distro }}\") | .box_version" ./molecule/config/windows.yml )
249249
eval "box_version=${box_version}"
250-
json=$( wget -nv -O- https://vagrantcloud.com/api/v2/vagrant/${box} )
250+
json=$( wget -nv -O- "https://vagrantcloud.com/api/v2/vagrant/${box}" )
251251
url=$( echo "$json" | jq -r ".versions[] | select(.version == \"${box_version}\") | .providers[] | select(.name == \"virtualbox\") | .url" )
252-
wget -nv -O /tmp/vagrant.box $url
252+
wget -nv -O /tmp/vagrant.box "$url"
253253
254254
- name: Clean VirtualBox cache
255255
run: |

.github/workflows/auto-instrumentation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
exclude='{"ARCH": "arm64", "TESTCASE": "dotnet"}'
8181
matrix="{\"DISTRO\": [${distro%,}], \"ARCH\": [${arch}], \"TESTCASE\": [${testcase}], \"exclude\": [${exclude}]}"
8282
echo "$matrix" | jq
83-
echo "matrix=${matrix}" >> $GITHUB_OUTPUT
83+
echo "matrix=${matrix}" >> "$GITHUB_OUTPUT"
8484
outputs:
8585
matrix: ${{ steps.get-matrix.outputs.matrix }}
8686

@@ -99,7 +99,7 @@ jobs:
9999
run: |
100100
for pkg in "deb" "rpm"; do
101101
if [[ -f "packaging/tests/instrumentation/images/${pkg}/Dockerfile.${{ matrix.DISTRO }}" ]]; then
102-
echo "SYS_PACKAGE=${pkg}" >> $GITHUB_ENV
102+
echo "SYS_PACKAGE=${pkg}" >> "$GITHUB_ENV"
103103
exit 0
104104
fi
105105
done

.github/workflows/build-and-test.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
- uses: actions/checkout@v4
6868
- uses: ./.github/actions/setup-environment
6969

70-
- run: echo "GOLANGCI_LINT_CACHE=${HOME}/.cache/golangci-lint" >> $GITHUB_ENV
70+
- run: echo "GOLANGCI_LINT_CACHE=${HOME}/.cache/golangci-lint" >> "$GITHUB_ENV"
7171

7272
- uses: actions/cache@v4
7373
with:
@@ -78,6 +78,18 @@ jobs:
7878
run: |
7979
make for-all CMD="make lint"
8080
81+
actionlint:
82+
runs-on: ubuntu-24.04
83+
steps:
84+
- uses: actions/checkout@v4
85+
- name: Download actionlint
86+
id: get_actionlint
87+
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/03d0035/scripts/download-actionlint.bash) # v1.7.7
88+
shell: bash
89+
- name: Check workflow files
90+
run: ${{ steps.get_actionlint.outputs.executable }} -color
91+
shell: bash
92+
8193
test:
8294
name: unit-test
8395
strategy:

.github/workflows/chef-test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ jobs:
255255
echo "Failed to get platforms from kitchen.yml!" >&2
256256
exit 1
257257
fi
258-
echo "matrix={'DISTRO': [${distros}]}" >> $GITHUB_OUTPUT
258+
echo "matrix={'DISTRO': [${distros}]}" >> "$GITHUB_OUTPUT"
259259
260260
- name: Get windows distros and suites
261261
id: get-win-matrix
@@ -270,7 +270,7 @@ jobs:
270270
echo "Failed to get suites from kitchen.windows.yml!" >&2
271271
exit 1
272272
fi
273-
echo "matrix={'DISTRO': [${distros}], 'SUITE': [${suites}]}" >> $GITHUB_OUTPUT
273+
echo "matrix={'DISTRO': [${distros}], 'SUITE': [${suites}]}" >> "$GITHUB_OUTPUT"
274274
outputs:
275275
linux-matrix: ${{ steps.get-linux-matrix.outputs.matrix }}
276276
win-matrix: ${{ steps.get-win-matrix.outputs.matrix }}
@@ -302,9 +302,9 @@ jobs:
302302
run: |
303303
mkdir -p files
304304
deb_path=$(find /tmp/deb-amd64-package/splunk-otel-collector*amd64.deb)
305-
mv $deb_path ./files/soc.deb
305+
mv "$deb_path" ./files/soc.deb
306306
rpm_path=$(find /tmp/rpm-amd64-package/splunk-otel-collector*x86_64.rpm)
307-
mv $rpm_path ./files/soc.rpm
307+
mv "$rpm_path" ./files/soc.rpm
308308
309309
- name: Install chef
310310
uses: actionshub/[email protected]

.github/workflows/chef.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
echo "Failed to get version from deployments/chef/metadata.rb"
3232
exit 1
3333
fi
34-
echo "version=${version}" >> $GITHUB_OUTPUT
34+
echo "version=${version}" >> "$GITHUB_OUTPUT"
3535
3636
- name: Push new release tag if it doesn't exist
3737
uses: actions/github-script@v7

.github/workflows/cleanup-closed-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
echo "Deleting caches..."
2828
for cacheKey in $cacheKeysForPR
2929
do
30-
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
30+
gh actions-cache delete "$cacheKey" -R $REPO -B $BRANCH --confirm
3131
done
3232
echo "Done"
3333
env:

.github/workflows/dotnet-instr-deployer-add-on.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ jobs:
102102
id: read-app-conf
103103
run: |
104104
version=$(grep -oP '^version = \K.*' packaging/dotnet-instr-deployer-add-on/assets/default/app.conf)
105-
echo "version=$version" >> $GITHUB_OUTPUT
105+
echo "version=$version" >> "$GITHUB_OUTPUT"
106106
107107
- name: Ensure version is read from app.conf
108108
if: steps.read-app-conf.outputs.version == ''

.github/workflows/installer-script-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
id: get-matrix
3131
run: |
3232
# create test matrix for distro images and archs
33-
dockerfiles=$(ls packaging/tests/images/deb/Dockerfile.* packaging/tests/images/rpm/Dockerfile.* | cut -d '.' -f2- | sort -u)
33+
dockerfiles=$(find packaging/tests/images/deb/Dockerfile.* packaging/tests/images/rpm/Dockerfile.* | cut -d '.' -f2- | sort -u)
3434
if [ -z "$dockerfiles" ]; then
3535
echo "Failed to get dockerfiles from packaging/tests/images!" >&2
3636
exit 1
@@ -40,7 +40,7 @@ jobs:
4040
instrumentation='"none","preload","systemd"'
4141
matrix="{\"DISTRO\": [${distro%,}], \"ARCH\": [${arch}], \"INSTRUMENTATION\": [${instrumentation}]}"
4242
echo "$matrix" | jq
43-
echo "matrix=${matrix}" >> $GITHUB_OUTPUT
43+
echo "matrix=${matrix}" >> "$GITHUB_OUTPUT"
4444
outputs:
4545
matrix: ${{ steps.get-matrix.outputs.matrix }}
4646

.github/workflows/integration-test.yml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ jobs:
160160
for image in $images; do
161161
service=$(basename "$image" | cut -d ':' -f1)
162162
if [[ -f docker/${service}/Dockerfile ]]; then
163-
docker build --cache-from=quay.io/splunko11ytest/${service}:latest -t quay.io/splunko11ytest/${service}:latest docker/${service}
163+
docker build --cache-from="quay.io/splunko11ytest/${service}:latest" -t "quay.io/splunko11ytest/${service}:latest" "docker/${service}"
164164
fi
165165
done
166166
docker system prune -f
@@ -207,11 +207,12 @@ jobs:
207207
if [[ "${{ matrix.PROFILE }}" = "smartagent" ]]; then
208208
target="smartagent-integration-test-with-cover"
209209
fi
210-
export CONTAINER_COVER_SRC="$(realpath .)/tests/coverage"
211-
make $target 2>&1 | tee $TEST_OUTPUT
210+
CONTAINER_COVER_SRC="$(realpath .)/tests/coverage"
211+
export CONTAINER_COVER_SRC
212+
make $target 2>&1 | tee "$TEST_OUTPUT"
212213
exit_status=${PIPESTATUS[0]}
213214
echo "Exit status: $exit_status"
214-
exit $exit_status
215+
exit "$exit_status"
215216
env:
216217
CONTAINER_COVER_DEST: '/etc/otel/collector/coverage'
217218
SPLUNK_OTEL_COLLECTOR_IMAGE: 'otelcol:latest'
@@ -253,7 +254,7 @@ jobs:
253254
for image in $images; do
254255
service=$(basename "$image" | cut -d ':' -f1)
255256
if [[ -f docker/${service}/Dockerfile ]]; then
256-
docker build --cache-from=quay.io/splunko11ytest/${service}:latest -t quay.io/splunko11ytest/${service}:latest docker/${service}
257+
docker build --cache-from="quay.io/splunko11ytest/${service}:latest" -t "quay.io/splunko11ytest/${service}:latest" "docker/${service}"
257258
fi
258259
done
259260
docker system prune -f
@@ -271,7 +272,7 @@ jobs:
271272
path: ./dist
272273
- run: sudo mkdir -p /usr/lib/splunk-otel-collector
273274
- run: sudo tar -xzf dist/agent-bundle_linux_amd64.tar.gz -C /usr/lib/splunk-otel-collector
274-
- run: sudo chown -R $USER /usr/lib/splunk-otel-collector
275+
- run: sudo chown -R "$USER" /usr/lib/splunk-otel-collector
275276
- run: /usr/lib/splunk-otel-collector/agent-bundle/bin/patch-interpreter /usr/lib/splunk-otel-collector/agent-bundle
276277
- uses: actions/download-artifact@v4
277278
with:
@@ -295,11 +296,12 @@ jobs:
295296
if [[ "${{ matrix.PROFILE }}" = "smartagent" ]]; then
296297
target="smartagent-integration-test-with-cover"
297298
fi
298-
export CONTAINER_COVER_SRC="$(realpath .)/tests/coverage"
299-
make $target 2>&1 | tee $TEST_OUTPUT
299+
CONTAINER_COVER_SRC="$(realpath .)/tests/coverage"
300+
export CONTAINER_COVER_SRC
301+
make $target 2>&1 | tee "$TEST_OUTPUT"
300302
exit_status=${PIPESTATUS[0]}
301303
echo "Exit status: $exit_status"
302-
exit $exit_status
304+
exit "$exit_status"
303305
env:
304306
CONTAINER_COVER_DEST: '/etc/otel/collector/coverage'
305307
SPLUNK_OTEL_COLLECTOR_IMAGE: ""
@@ -342,7 +344,7 @@ jobs:
342344
done
343345
matrix="{\"include\": [${includes#,}]}"
344346
echo "$matrix" | jq
345-
echo "matrix=${matrix}" >> $GITHUB_OUTPUT
347+
echo "matrix=${matrix}" >> "$GITHUB_OUTPUT"
346348
347349
integration-test-discovery:
348350
name: integration-test-discovery
@@ -375,7 +377,8 @@ jobs:
375377
- run: chmod a+x ./bin/*
376378
- name: Run ${{ matrix.SERVICE }} Discovery Integration Test With Cover
377379
run: |
378-
export CONTAINER_COVER_SRC="$(realpath .)/tests/coverage"
380+
CONTAINER_COVER_SRC="$(realpath .)/tests/coverage"
381+
export CONTAINER_COVER_SRC
379382
make integration-test-${{ matrix.SERVICE }}-discovery-with-cover
380383
env:
381384
CONTAINER_COVER_DEST: '/etc/otel/collector/coverage'
@@ -404,7 +407,7 @@ jobs:
404407
done
405408
matrix="{\"include\": [${includes#,}]}"
406409
echo "$matrix" | jq
407-
echo "matrix=${matrix}" >> $GITHUB_OUTPUT
410+
echo "matrix=${matrix}" >> "$GITHUB_OUTPUT"
408411
409412
integration-test-discovery-k8s:
410413
name: integration-test-discovery-k8s
@@ -447,15 +450,16 @@ jobs:
447450
kind load docker-image otelcol:latest --name kind
448451
- name: Run ${{ matrix.SERVICE }} Discovery Kubernetes Integration Test With Cover
449452
run: |
450-
export CONTAINER_COVER_SRC="$(realpath .)/tests/coverage"
453+
CONTAINER_COVER_SRC="$(realpath .)/tests/coverage"
454+
export CONTAINER_COVER_SRC
451455
KUBECONFIG=$HOME/.kube/config SKIP_TEARDOWN=true make integration-test-${{ matrix.SERVICE }}-discovery-k8s-with-cover
452456
env:
453457
CONTAINER_COVER_DEST: '/etc/otel/collector/coverage'
454458
- name: Print logs
455459
if: failure()
456460
run: |
457461
kubectl get pods -A
458-
kubectl get pod -A -l app=otelcol -o jsonpath="{range .items[*]}{.metadata.namespace} {.metadata.name}{'\n'}{end}" | xargs -r -n2 sh -c 'kubectl logs -n $0 $1'
462+
kubectl get pod -A -l app=otelcol -o jsonpath="{range .items[*]}{.metadata.namespace} {.metadata.name}{'\n'}{end}" | xargs -r -n2 sh -c "kubectl logs -n $0 $1"
459463
- name: Upload coverage report
460464
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # 5.4.3
461465
with:

.github/workflows/lint-examples.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ jobs:
3333
- name: Lint
3434
run: |
3535
make install-tools
36-
for gomod in $(find examples -name "go.mod"); do
37-
dir=$(dirname $gomod)
38-
pushd $dir >/dev/null
36+
shopt -s globstar nullglob
37+
for gomod in examples/**/go.mod; do
38+
dir=$(dirname "$gomod")
39+
pushd "$dir" >/dev/null
3940
echo "Running 'make lint' in $dir ..."
4041
make lint
4142
popd >/dev/null

.github/workflows/linux-package-test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
arch="\"amd64\", \"arm64\""
7474
matrix="{\"DISTRO\": [${distro%,}], \"ARCH\": [${arch}]}"
7575
echo "$matrix" | jq
76-
echo "matrix=${matrix}" >> $GITHUB_OUTPUT
76+
echo "matrix=${matrix}" >> "$GITHUB_OUTPUT"
7777
outputs:
7878
matrix: ${{ steps.get-matrix.outputs.matrix }}
7979

@@ -92,7 +92,7 @@ jobs:
9292
run: |
9393
for pkg in "deb" "rpm" "tar"; do
9494
if [[ -f "packaging/tests/images/${pkg}/Dockerfile.${{ matrix.DISTRO }}" ]]; then
95-
echo "SYS_PACKAGE=${pkg}" >> $GITHUB_ENV
95+
echo "SYS_PACKAGE=${pkg}" >> "$GITHUB_ENV"
9696
exit 0
9797
fi
9898
done
@@ -264,18 +264,18 @@ jobs:
264264
265265
# get all provided config files from the container
266266
tmpdir=$(mktemp -d)
267-
docker cp otelcol:/etc/otel/collector $tmpdir
267+
docker cp otelcol:/etc/otel/collector "$tmpdir"
268268
docker rm -f otelcol
269269
270270
# ensure the collector can start with all provided config files
271-
configs=$(ls ${tmpdir}/collector/ 2>/dev/null)
271+
configs=$(ls "${tmpdir}/collector/" 2>/dev/null)
272272
if [ -z "$configs" ]; then
273273
echo "failed to get config files from otelcol:/etc/otel/collector"
274274
exit 1
275275
fi
276276
for config in $configs; do
277277
# TODO: set fake-token back to 12345 once https://github.com/open-telemetry/opentelemetry-collector/issues/10937 is resolved
278-
docker run --platform linux/${{ matrix.ARCH }} -d -e SPLUNK_CONFIG=/etc/otel/collector/${config} -e SPLUNK_ACCESS_TOKEN=fake-token -e SPLUNK_REALM=fake-realm -e ECS_CONTAINER_METADATA_URI_V4=http://localhost --name otelcol otelcol:latest
278+
docker run --platform linux/${{ matrix.ARCH }} -d -e SPLUNK_CONFIG="/etc/otel/collector/${config}" -e SPLUNK_ACCESS_TOKEN=fake-token -e SPLUNK_REALM=fake-realm -e ECS_CONTAINER_METADATA_URI_V4=http://localhost --name otelcol otelcol:latest
279279
sleep 10
280280
if [ -z "$( docker ps --filter=status=running --filter=name=otelcol -q )" ]; then
281281
docker logs otelcol

0 commit comments

Comments
 (0)