diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e438595..6c50fa7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -157,7 +157,7 @@ jobs: DOCKERHUB_USER: ${{ steps.secrets.outputs.user }} DOCKERHUB_PASSWORD: ${{ steps.secrets.outputs.password }} INJECTION_STRATEGY: ${{ matrix.INJECTION_STRATEGY }} - WALLARM_API_TOKEN: ${{ steps.secrets.outputs.api_token }} + WALLARM_API_TOKEN: ${{ steps.secrets.outputs.user_token }} WALLARM_API_HOST: ${{ steps.secrets.outputs.api_host }} WALLARM_API_PRESET: ${{ steps.secrets.outputs.api_preset }} USER_TOKEN: ${{ steps.secrets.outputs.user_token }} diff --git a/Makefile b/Makefile index 3bb545e..8e7a4f7 100644 --- a/Makefile +++ b/Makefile @@ -84,7 +84,8 @@ clean-all: ### Helm routines ### HELMARGS := --set "config.wallarm.api.token=$(WALLARM_API_TOKEN)" \ - --set "config.wallarm.api.host=$(WALLARM_API_HOST)" + --set "config.wallarm.api.host=$(WALLARM_API_HOST)" \ + --set "config.wallarm.api.nodeGroup=$(NODE_GROUP_NAME)" \ helm-template: @$(HELM) template wallarm-sidecar ./helm -f ./helm/values.dev.yaml $(HELMARGS) --debug diff --git a/test/smoke/functions.sh b/test/smoke/functions.sh index e1c15fc..e9f0fbb 100644 --- a/test/smoke/functions.sh +++ b/test/smoke/functions.sh @@ -18,6 +18,7 @@ function check_mandatory_vars() { WEBHOOK_UUID SMOKE_REGISTRY_TOKEN SMOKE_REGISTRY_SECRET + NODE_GROUP_NAME ) env_list="" diff --git a/test/smoke/run-smoke-suite.sh b/test/smoke/run-smoke-suite.sh index 1420255..a8365c2 100755 --- a/test/smoke/run-smoke-suite.sh +++ b/test/smoke/run-smoke-suite.sh @@ -57,16 +57,8 @@ if ! kubectl get secret "${SMOKE_IMAGE_PULL_SECRET_NAME}" &> /dev/null; then --docker-email=docker-pull@unexists.unexists fi -echo "Retrieving Wallarm Node UUID ..." -POD=$(kubectl get pod -l app=workload -o=name | cut -d/ -f 2) -NODE_UUID=$(kubectl exec "${POD}" -c sidecar-proxy -- cat /opt/wallarm/etc/wallarm/node.yaml | grep uuid | awk '{print $2}' | xargs) -if [[ -z "${NODE_UUID}" ]]; then - echo "Failed to retrieve Wallarm Node UUID" - get_logs_and_fail -fi -echo "Node UUID: ${NODE_UUID}" - echo "Retrieving Wallarm NODE_VERSION ..." +POD=$(kubectl get pod -l app=workload -o=name | cut -d/ -f 2) NODE_VERSION=$(kubectl get pod ${POD} -o jsonpath="{.spec.containers[?(@.name=='sidecar-proxy')].image}" | awk -F ":" '{print $2}') echo "Node version: ${NODE_VERSION}" @@ -89,7 +81,6 @@ spec: - command: [sleep, infinity] env: - {name: NODE_BASE_URL, value: "${NODE_BASE_URL}"} - - {name: NODE_UUID, value: "${NODE_UUID}"} - {name: WALLARM_API_HOST, value: "${WALLARM_API_HOST}"} - {name: WALLARM_API_PRESET, value: "${WALLARM_API_PRESET}"} - {name: API_CA_VERIFY, value: "${WALLARM_API_CA_VERIFY}"} diff --git a/test/smoke/run.sh b/test/smoke/run.sh index cb67f60..6143877 100755 --- a/test/smoke/run.sh +++ b/test/smoke/run.sh @@ -1,8 +1,11 @@ #!/bin/bash -#import functions +# import functions source "${PWD}/test/smoke/functions.sh" +# generate unique group name +export NODE_GROUP_NAME="github-sidecar-$(tr -dc A-Za-z0-9