From 051b84473f68f7dfb2211eecdce0a231c15e1794 Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Tue, 14 Jan 2025 15:36:50 -0800 Subject: [PATCH 1/3] [chore] add a test checking upgrades from a previous release --- .github/workflows/functional_test_v2.yaml | 72 +++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/.github/workflows/functional_test_v2.yaml b/.github/workflows/functional_test_v2.yaml index c0826b47ab..d2b5d24fa6 100644 --- a/.github/workflows/functional_test_v2.yaml +++ b/.github/workflows/functional_test_v2.yaml @@ -224,6 +224,78 @@ jobs: cd functional_tests go test -v -tags functional + eks-upgrade-from-release-test: + name: Test helm upgrade from release in EKS - credentials needed + needs: kubernetes-test + if: github.event.pull_request.head.repo.full_name == github.repository + concurrency: + group: eks-access + env: + KUBECONFIG: /tmp/kube-config-splunk-otel-collector-chart-functional-testing-eks + KUBE_TEST_ENV: eks + SKIP_TESTS: "true" # we need to skip functional tests as we have not set probes to listen to the traffic. + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Checkout main if in a PR + if: github.event_name == 'pull_request' + uses: actions/checkout@v4 + with: + path: base + ref: main + - name: Checkout previous main commit if in main + if: github.event_name != 'pull_request' + uses: actions/checkout@v4 + with: + path: base + ref: HEAD + fetch-depth: 2 + - name: Checkout fixed previous release v0.109.0 + if: github.event_name != 'pull_request' + run: cd base && git checkout splunk-otel-collector-0.109.0 + - uses: actions/setup-go@v5 + with: + go-version: ~1.21.8 + cache: false + - name: Cache Go + id: go-cache + timeout-minutes: 5 + uses: actions/cache@v4 + with: + path: | + ~/go/bin + ~/go/pkg/mod + key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }} + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.AWS_KEY }} + aws-secret-access-key: ${{ secrets.AWS_SECRET }} + aws-region: us-west-1 + - name: Install kubeconfig + run: | + aws eks update-kubeconfig --name rotel-eks --region us-west-1 + - name: Update dependencies + run: | + cd base && make dep-update + - name: Deploy cert-manager + run: | + cd base && make cert-manager + - name: Deploy previous version of the chart + run: | + cd base && helm install sock helm-charts/splunk-otel-collector --set cloudProvider=aws --set distribution=eks --set splunkObservability.realm=us0 --set splunkObservability.accessToken=xxxxx + - name: Update dependencies + run: | + make dep-update + - name: Deploy cert-manager + run: | + make cert-manager + - name: run functional tests + env: + HOST_ENDPOINT: 0.0.0.0 + run: | + cd functional_tests + go test -v -tags functional gke-autopilot-test: name: Test helm install in GKE/Autopilot - credentials needed needs: kubernetes-test From 503d439101a1ad214463e455ced64a860a890143 Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Tue, 14 Jan 2025 17:05:58 -0800 Subject: [PATCH 2/3] install operator initially --- .github/workflows/functional_test_v2.yaml | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/.github/workflows/functional_test_v2.yaml b/.github/workflows/functional_test_v2.yaml index d2b5d24fa6..d03789fd88 100644 --- a/.github/workflows/functional_test_v2.yaml +++ b/.github/workflows/functional_test_v2.yaml @@ -237,22 +237,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Checkout main if in a PR - if: github.event_name == 'pull_request' - uses: actions/checkout@v4 - with: - path: base - ref: main - - name: Checkout previous main commit if in main - if: github.event_name != 'pull_request' + - name: Checkout old release uses: actions/checkout@v4 with: path: base - ref: HEAD - fetch-depth: 2 - - name: Checkout fixed previous release v0.109.0 - if: github.event_name != 'pull_request' - run: cd base && git checkout splunk-otel-collector-0.109.0 + ref: splunk-otel-collector-0.109.0 + fetch-depth: 0 - uses: actions/setup-go@v5 with: go-version: ~1.21.8 @@ -283,7 +273,7 @@ jobs: cd base && make cert-manager - name: Deploy previous version of the chart run: | - cd base && helm install sock helm-charts/splunk-otel-collector --set cloudProvider=aws --set distribution=eks --set splunkObservability.realm=us0 --set splunkObservability.accessToken=xxxxx + cd base && helm install sock helm-charts/splunk-otel-collector --set cloudProvider=aws --set distribution=eks --set splunkObservability.realm=us0 --set splunkObservability.accessToken=xxxxx --set operator.enabled=true --set certmanager.enabled=true --set environment=dev - name: Update dependencies run: | make dep-update From 31ac62d8dd6ddc31af2338dacb4e792879fe4b7e Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Tue, 14 Jan 2025 20:01:43 -0800 Subject: [PATCH 3/3] do not try to install cert-manager as part of helm chart install --- .github/workflows/functional_test_v2.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/functional_test_v2.yaml b/.github/workflows/functional_test_v2.yaml index d03789fd88..3d72429d19 100644 --- a/.github/workflows/functional_test_v2.yaml +++ b/.github/workflows/functional_test_v2.yaml @@ -273,7 +273,7 @@ jobs: cd base && make cert-manager - name: Deploy previous version of the chart run: | - cd base && helm install sock helm-charts/splunk-otel-collector --set cloudProvider=aws --set distribution=eks --set splunkObservability.realm=us0 --set splunkObservability.accessToken=xxxxx --set operator.enabled=true --set certmanager.enabled=true --set environment=dev + cd base && helm install sock helm-charts/splunk-otel-collector --set cloudProvider=aws --set distribution=eks --set splunkObservability.realm=us0 --set splunkObservability.accessToken=xxxxx --set operator.enabled=true --set environment=dev - name: Update dependencies run: | make dep-update