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

NODE-5888 Use node group instead of node uuid #196

Merged
merged 1 commit into from
Dec 3, 2024
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 .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions test/smoke/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ function check_mandatory_vars() {
WEBHOOK_UUID
SMOKE_REGISTRY_TOKEN
SMOKE_REGISTRY_SECRET
NODE_GROUP_NAME
)

env_list=""
Expand Down
12 changes: 2 additions & 10 deletions test/smoke/run-smoke-suite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,8 @@ if ! kubectl get secret "${SMOKE_IMAGE_PULL_SECRET_NAME}" &> /dev/null; then
[email protected]
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}"

Expand All @@ -89,7 +81,7 @@ spec:
- command: [sleep, infinity]
env:
- {name: NODE_BASE_URL, value: "${NODE_BASE_URL}"}
- {name: NODE_UUID, value: "${NODE_UUID}"}
- {name: NODE_GROUP_NAME, value: "${NODE_GROUP_NAME}"}
- {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}"}
Expand Down
6 changes: 5 additions & 1 deletion test/smoke/run.sh
Original file line number Diff line number Diff line change
@@ -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 </dev/urandom | head -c 12; echo)"

# check if all mandatory vars was defined
check_mandatory_vars

Expand Down Expand Up @@ -138,6 +141,7 @@ config:
api:
token: ${WALLARM_API_TOKEN}
host: ${WALLARM_API_HOST}
nodeGroup: ${NODE_GROUP_NAME}
injectionStrategy:
schema: ${INJECTION_STRATEGY}
controller:
Expand Down