[Snyk] Security upgrade mongo from 4.2 to 4.4.29 #29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: e2e-tests | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+*' | |
pull_request: | |
jobs: | |
kubernetes-test: | |
strategy: | |
matrix: | |
k8s-version: ["v1.26.0", "v1.25.3", "v1.24.7", "v1.23.13"] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.19 | |
- name: Cache Go | |
id: go-cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/go/bin | |
~/go/pkg/mod | |
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }} | |
- name: Install dependencies | |
if: steps.go-cache.outputs.cache-hit != 'true' | |
run: make -j2 gomoddownload | |
- name: Build Collector | |
run: make otelcontribcol | |
- name: Build Docker Image | |
run: | | |
make docker-otelcontribcol | |
docker tag otelcontribcol:latest otel/opentelemetry-collector-contrib-dev:$GITHUB_SHA | |
- name: Set up Helm | |
uses: azure/setup-helm@v3.5 | |
with: | |
version: v3.9.0 | |
- name: Set up chart-testing | |
uses: helm/chart-testing-action@v2.3.1 | |
- name: Create kind cluster | |
uses: helm/kind-action@v1.5.0 | |
with: | |
node_image: kindest/node:${{ matrix.k8s-version }} | |
kubectl_version: ${{ matrix.k8s-version }} | |
- name: Check kind | |
run: | | |
kubectl cluster-info --context kind-chart-testing | |
kubectl get node | |
docker ps -a --filter label=io.x-k8s.kind.cluster=chart-testing | |
- name: Kind load image | |
run: | | |
kind load docker-image otel/opentelemetry-collector-contrib-dev:$GITHUB_SHA --name chart-testing | |
- name: Add Dependencies | |
shell: bash | |
run: | | |
helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts | |
- uses: actions/checkout@v3 | |
with: | |
repository: 'open-telemetry/opentelemetry-helm-charts' | |
path: opentelemetry-helm-charts | |
- name: Helm install collector | |
run: helm install test --set image.tag=$GITHUB_SHA -f .github/workflows/e2e/k8s/collector-helm-values.yml opentelemetry-helm-charts/charts/opentelemetry-collector | |
- name: check collector status | |
run: | | |
kubectl wait --for=condition=Ready --timeout=60s pod/test-opentelemetry-collector-0 | |
- name: start telemetrygen job for trace, metric, log | |
run: | | |
sed 's/DATA_TYPE/traces/g' .github/workflows/e2e/k8s/telemetrygen-job.yml | kubectl -n default create -f - | |
sed 's/DATA_TYPE/metrics/g' .github/workflows/e2e/k8s/telemetrygen-job.yml | kubectl -n default create -f - | |
sed 's/DATA_TYPE/logs/g' .github/workflows/e2e/k8s/telemetrygen-job.yml | kubectl -n default create -f - | |
- name: check telemetrygen job status | |
run: | | |
kubectl wait --for=condition=Complete --timeout=60s job/telemetrygen-traces-job | |
kubectl wait --for=condition=Complete --timeout=60s job/telemetrygen-metrics-job | |
kubectl wait --for=condition=Complete --timeout=60s job/telemetrygen-logs-job | |
- name: start telemetrygen statefulset for trace, metric, log | |
run: | | |
sed 's/DATA_TYPE/traces/g' .github/workflows/e2e/k8s/telemetrygen-statefulset.yml | kubectl -n default create -f - | |
sed 's/DATA_TYPE/metrics/g' .github/workflows/e2e/k8s/telemetrygen-statefulset.yml | kubectl -n default create -f - | |
sed 's/DATA_TYPE/logs/g' .github/workflows/e2e/k8s/telemetrygen-statefulset.yml | kubectl -n default create -f - | |
- name: start telemetrygen deployment for trace, metric, log | |
run: | | |
sed 's/DATA_TYPE/traces/g' .github/workflows/e2e/k8s/telemetrygen-deployment.yml | kubectl -n default create -f - | |
sed 's/DATA_TYPE/metrics/g' .github/workflows/e2e/k8s/telemetrygen-deployment.yml | kubectl -n default create -f - | |
sed 's/DATA_TYPE/logs/g' .github/workflows/e2e/k8s/telemetrygen-deployment.yml | kubectl -n default create -f - | |
- name: start telemetrygen daemonset for trace, metric, log | |
run: | | |
sed 's/DATA_TYPE/traces/g' .github/workflows/e2e/k8s/telemetrygen-daemonset.yml | kubectl -n default create -f - | |
sed 's/DATA_TYPE/metrics/g' .github/workflows/e2e/k8s/telemetrygen-daemonset.yml | kubectl -n default create -f - | |
sed 's/DATA_TYPE/logs/g' .github/workflows/e2e/k8s/telemetrygen-daemonset.yml | kubectl -n default create -f - | |
- name: wait telemetrygen statefulset/deployment/daemonset to generate trace and metric, log | |
run: | | |
sleep 30 | |
- name: copy telemetry trace, metric, log data output | |
run: | | |
kubectl cp -c filecp default/test-opentelemetry-collector-0:tmp/trace.json processor/k8sattributesprocessor/testdata/trace.json | |
kubectl cp -c filecp default/test-opentelemetry-collector-0:tmp/metric.json processor/k8sattributesprocessor/testdata/metric.json | |
kubectl cp -c filecp default/test-opentelemetry-collector-0:tmp/log.json processor/k8sattributesprocessor/testdata/log.json | |
- name: run e2e test to check output | |
run: | | |
cd processor/k8sattributesprocessor | |
go test -v --tags=e2e |