From 879da944770ce2e80c19dd4f7f571a4b662c46f4 Mon Sep 17 00:00:00 2001 From: eli Date: Mon, 3 Nov 2025 15:31:10 -0600 Subject: [PATCH 01/12] Now checks if entries array has items --- templates/deployment-client.yaml | 2 +- templates/deployment-server.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/deployment-client.yaml b/templates/deployment-client.yaml index 2129e30..5c620c3 100644 --- a/templates/deployment-client.yaml +++ b/templates/deployment-client.yaml @@ -66,7 +66,7 @@ spec: - name: OPAL_SERVER_URL value: {{ printf "http://%s:%v" (include "opal.serverName" .) .Values.server.port | quote }} {{- end}} - {{- if not (or (.Values.server.dataConfigSources.external_source_url) (.Values.server.dataConfigSources.config) (hasKey .Values.client.extraEnv "OPAL_DATA_UPDATER_ENABLED") ) }} + {{- if not (or (.Values.server.dataConfigSources.external_source_url) (and .Values.server.dataConfigSources.config .Values.server.dataConfigSources.config.entries) (hasKey .Values.client.extraEnv "OPAL_DATA_UPDATER_ENABLED") ) }} - name: OPAL_DATA_UPDATER_ENABLED value: "False" {{- end }} diff --git a/templates/deployment-server.yaml b/templates/deployment-server.yaml index 0ad9e6b..f731688 100644 --- a/templates/deployment-server.yaml +++ b/templates/deployment-server.yaml @@ -124,7 +124,7 @@ spec: {{- end }} - name: UVICORN_NUM_WORKERS value: {{ .Values.server.uvicornWorkers | quote }} - {{- if or .Values.server.dataConfigSources.config .Values.server.dataConfigSources.external_source_url }} + {{- if or .Values.server.dataConfigSources.external_source_url (and .Values.server.dataConfigSources.config .Values.server.dataConfigSources.config.entries) }} - name: OPAL_DATA_CONFIG_SOURCES value: {{ .Values.server.dataConfigSources | toRawJson | squote }} {{- end}} From b82a8f22a4174392c24906b06e14e2ff09176d49 Mon Sep 17 00:00:00 2001 From: eli Date: Mon, 3 Nov 2025 21:02:53 -0600 Subject: [PATCH 02/12] Fix helm lint --- templates/deployment-client.yaml | 2 +- templates/deployment-server.yaml | 2 +- templates/service-client.yaml | 2 +- templates/service-server.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/deployment-client.yaml b/templates/deployment-client.yaml index 5c620c3..6f6c4c5 100644 --- a/templates/deployment-client.yaml +++ b/templates/deployment-client.yaml @@ -1,5 +1,5 @@ {{- if .Values.client }} -{{- if ne .Values.client.enabled false }} +{{- if ne (.Values.client.enabled | default true) false }} {{- $nm := include "opal.clientName" . | quote }} apiVersion: apps/v1 kind: Deployment diff --git a/templates/deployment-server.yaml b/templates/deployment-server.yaml index f731688..a34d904 100644 --- a/templates/deployment-server.yaml +++ b/templates/deployment-server.yaml @@ -1,5 +1,5 @@ {{- if .Values.server }} -{{- if ne .Values.server.enabled false }} +{{- if ne (.Values.server.enabled | default true) false }} {{- $nm := include "opal.serverName" . | quote }} apiVersion: apps/v1 kind: Deployment diff --git a/templates/service-client.yaml b/templates/service-client.yaml index b590986..3dcd045 100644 --- a/templates/service-client.yaml +++ b/templates/service-client.yaml @@ -1,5 +1,5 @@ {{- if .Values.client }} -{{- if ne .Values.client.enabled false }} +{{- if ne (.Values.client.enabled | default true) false }} apiVersion: v1 kind: Service metadata: diff --git a/templates/service-server.yaml b/templates/service-server.yaml index 1ddb4fd..ab0e960 100644 --- a/templates/service-server.yaml +++ b/templates/service-server.yaml @@ -1,5 +1,5 @@ {{- if .Values.server }} -{{- if ne .Values.server.enabled false }} +{{- if ne (.Values.server.enabled | default true) false }} apiVersion: v1 kind: Service metadata: From c207d078203b209fd951a54df1e76ebefd43a7d6 Mon Sep 17 00:00:00 2001 From: eli Date: Mon, 3 Nov 2025 21:25:27 -0600 Subject: [PATCH 03/12] Upgrade CI Helm version and revert unnecessary template changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The helm lint failures in CI were caused by using outdated Helm 3.3.4 (from 2020). The template syntax `ne .Values.server.enabled false` works correctly with modern Helm versions. Changes: - Upgraded CI Helm version from 3.3.4 to 3.19.0 (latest stable) - Reverted commit b82a8f2 template changes (not needed with modern Helm) Testing confirmed: - All helm lint tests pass with Helm 3.14+ and 3.19.0 - Customer issue (empty dataConfigSources entries) remains fixed - Original template syntax is compatible with modern Helm 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .github/workflows/master.yaml | 2 +- templates/deployment-client.yaml | 2 +- templates/deployment-server.yaml | 2 +- templates/service-client.yaml | 2 +- templates/service-server.yaml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/master.yaml b/.github/workflows/master.yaml index d070463..8b388b6 100644 --- a/.github/workflows/master.yaml +++ b/.github/workflows/master.yaml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v2 - uses: azure/setup-helm@v1 with: - version: "3.3.4" + version: "3.19.0" - name: helm lint run: | jq --version diff --git a/templates/deployment-client.yaml b/templates/deployment-client.yaml index 6f6c4c5..5c620c3 100644 --- a/templates/deployment-client.yaml +++ b/templates/deployment-client.yaml @@ -1,5 +1,5 @@ {{- if .Values.client }} -{{- if ne (.Values.client.enabled | default true) false }} +{{- if ne .Values.client.enabled false }} {{- $nm := include "opal.clientName" . | quote }} apiVersion: apps/v1 kind: Deployment diff --git a/templates/deployment-server.yaml b/templates/deployment-server.yaml index a34d904..f731688 100644 --- a/templates/deployment-server.yaml +++ b/templates/deployment-server.yaml @@ -1,5 +1,5 @@ {{- if .Values.server }} -{{- if ne (.Values.server.enabled | default true) false }} +{{- if ne .Values.server.enabled false }} {{- $nm := include "opal.serverName" . | quote }} apiVersion: apps/v1 kind: Deployment diff --git a/templates/service-client.yaml b/templates/service-client.yaml index 3dcd045..b590986 100644 --- a/templates/service-client.yaml +++ b/templates/service-client.yaml @@ -1,5 +1,5 @@ {{- if .Values.client }} -{{- if ne (.Values.client.enabled | default true) false }} +{{- if ne .Values.client.enabled false }} apiVersion: v1 kind: Service metadata: diff --git a/templates/service-server.yaml b/templates/service-server.yaml index ab0e960..1ddb4fd 100644 --- a/templates/service-server.yaml +++ b/templates/service-server.yaml @@ -1,5 +1,5 @@ {{- if .Values.server }} -{{- if ne (.Values.server.enabled | default true) false }} +{{- if ne .Values.server.enabled false }} apiVersion: v1 kind: Service metadata: From de3c3e52619605f3848ac722ab04bebb6416e38c Mon Sep 17 00:00:00 2001 From: eli Date: Mon, 3 Nov 2025 21:30:48 -0600 Subject: [PATCH 04/12] Upgrade k3d-action and k3s version to fix CI cluster startup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The k3d cluster startup was failing due to using outdated versions: - k3d-action v1.4.0 (from 2021) → v2.4.0 (latest, Jan 2024) - k3s v1.18.18 (from 2021) → v1.28.8 (modern, stable) - k3d config API v1alpha2 → v1alpha4 (current) Changes: - Upgraded k3d-action from v1.4.0 to v2.4.0 - Updated k3d config API version from v1alpha2 to v1alpha4 - Upgraded k3s image from v1.18.18-k3s1 to v1.28.8-k3s1 This should resolve the "server is currently unable to handle the request" errors seen during cluster startup in CI. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .github/workflows/master.yaml | 2 +- test/e2e/k3d.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/master.yaml b/.github/workflows/master.yaml index 8b388b6..636f621 100644 --- a/.github/workflows/master.yaml +++ b/.github/workflows/master.yaml @@ -22,7 +22,7 @@ jobs: jq --version ./test/linter/test.sh - name: start k8s with k3d - uses: AbsaOSS/k3d-action@v1.4.0 + uses: AbsaOSS/k3d-action@v2.4.0 with: cluster-name: "opal" use-default-registry: false diff --git a/test/e2e/k3d.yaml b/test/e2e/k3d.yaml index f055a3f..c82d224 100644 --- a/test/e2e/k3d.yaml +++ b/test/e2e/k3d.yaml @@ -1,7 +1,7 @@ -apiVersion: k3d.io/v1alpha2 +apiVersion: k3d.io/v1alpha4 kind: Simple name: k3d -image: rancher/k3s:v1.18.18-k3s1 +image: rancher/k3s:v1.28.8-k3s1 options: k3d: wait: true From 363a212f28073a20d634cc3dceff8b3578a1773f Mon Sep 17 00:00:00 2001 From: eli Date: Mon, 3 Nov 2025 21:33:50 -0600 Subject: [PATCH 05/12] Fix k3d config schema for v1alpha4 compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The k3d v1alpha4 schema requires different structure: - name field must be under metadata - extraServerArgs changed to extraArgs with arg/nodeFilters structure - Each disable flag must be a separate arg entry Changes: - Moved name under metadata wrapper - Changed extraServerArgs to extraArgs - Split --disable flags into separate arg entries with nodeFilters - Each arg targets server:* nodes This fixes the schema validation errors: - "Additional property name is not allowed" - "Additional property extraServerArgs is not allowed" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- test/e2e/k3d.yaml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/test/e2e/k3d.yaml b/test/e2e/k3d.yaml index c82d224..4e6513c 100644 --- a/test/e2e/k3d.yaml +++ b/test/e2e/k3d.yaml @@ -1,11 +1,20 @@ apiVersion: k3d.io/v1alpha4 kind: Simple -name: k3d +metadata: + name: k3d image: rancher/k3s:v1.28.8-k3s1 options: k3d: wait: true disableLoadbalancer: true k3s: - extraServerArgs: - - "--disable=metrics-server,servicelb,traefik" + extraArgs: + - arg: --disable=metrics-server + nodeFilters: + - server:* + - arg: --disable=servicelb + nodeFilters: + - server:* + - arg: --disable=traefik + nodeFilters: + - server:* From 7eae41f15eb57b6fdf4672daba04a5e6d03fac84 Mon Sep 17 00:00:00 2001 From: eli Date: Mon, 3 Nov 2025 21:43:20 -0600 Subject: [PATCH 06/12] Fix e2e test service names to match Helm naming convention MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The e2e tests were using incorrect service names that didn't match the actual services created by Helm. Issue: When release name != chart name, Helm generates service names as: {release-name}-{chart-name}-{component} In this case: - Release: myopal - Chart: opal - Generated names: myopal-opal-server, myopal-opal-client But tests were looking for: myopal-server, myopal-client Changes: - deploy.sh: myopal-server → myopal-opal-server - test.sh: myopal-client → myopal-opal-client - test.sh: myopal-server → myopal-opal-server This fixes the "service not found" error in CI e2e tests. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- test/e2e/deploy.sh | 2 +- test/e2e/test.sh | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/e2e/deploy.sh b/test/e2e/deploy.sh index b173503..353e6f6 100755 --- a/test/e2e/deploy.sh +++ b/test/e2e/deploy.sh @@ -13,4 +13,4 @@ else --set server.policyRepoUrl='//opt/e2e/policy-repo.git' fi -kubectl logs -n opal service/myopal-server git-init +kubectl logs -n opal service/myopal-opal-server git-init diff --git a/test/e2e/test.sh b/test/e2e/test.sh index d57a797..ea50ee2 100755 --- a/test/e2e/test.sh +++ b/test/e2e/test.sh @@ -7,13 +7,13 @@ helm test -n opal --logs myopal DATA_URL='http://localhost:8181/v1/data' -[ $(kubectl exec -n opal service/myopal-client -- curl -s ${DATA_URL}/users) != "{}" ] +[ $(kubectl exec -n opal service/myopal-opal-client -- curl -s ${DATA_URL}/users) != "{}" ] if [ -z $MSYSTEM ]; then - kubectl exec -n opal service/myopal-server -- /opt/e2e/policy-repo-data/upd.sh + kubectl exec -n opal service/myopal-opal-server -- /opt/e2e/policy-repo-data/upd.sh else - kubectl exec -n opal service/myopal-server -- //opt/e2e/policy-repo-data/upd.sh + kubectl exec -n opal service/myopal-opal-server -- //opt/e2e/policy-repo-data/upd.sh fi sleep 7 -[ $(kubectl exec -n opal service/myopal-client -- curl -s ${DATA_URL}/users) == "{}" ] -[ $(kubectl exec -n opal service/myopal-client -- curl -s ${DATA_URL}/losers) != "{}" ] +[ $(kubectl exec -n opal service/myopal-opal-client -- curl -s ${DATA_URL}/users) == "{}" ] +[ $(kubectl exec -n opal service/myopal-opal-client -- curl -s ${DATA_URL}/losers) != "{}" ] From d48794f98c18f4eaa7763ebd4dd81ad199b1a02d Mon Sep 17 00:00:00 2001 From: eli Date: Mon, 3 Nov 2025 21:46:18 -0600 Subject: [PATCH 07/12] Fix e2e test to use external curl pod instead of exec into client MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The OPAL client container doesn't have curl installed, causing the test to fail when trying to exec curl commands inside the container. Error: exec: "curl": executable file not found in $PATH Solution: - Use kubectl run with curlimages/curl image to query OPA from outside - Changed DATA_URL from localhost:8181 to service name myopal-opal-client:8181 - This matches the pattern used in templates/tests/e2e.yaml Changes: - Replaced kubectl exec with kubectl run --rm for curl commands - Updated URL to use service name instead of localhost 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- test/e2e/test.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/e2e/test.sh b/test/e2e/test.sh index ea50ee2..ff5475f 100755 --- a/test/e2e/test.sh +++ b/test/e2e/test.sh @@ -5,9 +5,9 @@ set -e helm test -n opal --logs myopal -DATA_URL='http://localhost:8181/v1/data' +DATA_URL="http://myopal-opal-client:8181/v1/data" -[ $(kubectl exec -n opal service/myopal-opal-client -- curl -s ${DATA_URL}/users) != "{}" ] +[ $(kubectl run -n opal curl-test --image=curlimages/curl:latest --rm -i --restart=Never -- curl -s ${DATA_URL}/users) != "{}" ] if [ -z $MSYSTEM ]; then kubectl exec -n opal service/myopal-opal-server -- /opt/e2e/policy-repo-data/upd.sh else @@ -15,5 +15,5 @@ else fi sleep 7 -[ $(kubectl exec -n opal service/myopal-opal-client -- curl -s ${DATA_URL}/users) == "{}" ] -[ $(kubectl exec -n opal service/myopal-opal-client -- curl -s ${DATA_URL}/losers) != "{}" ] +[ $(kubectl run -n opal curl-test --image=curlimages/curl:latest --rm -i --restart=Never -- curl -s ${DATA_URL}/users) == "{}" ] +[ $(kubectl run -n opal curl-test --image=curlimages/curl:latest --rm -i --restart=Never -- curl -s ${DATA_URL}/losers) != "{}" ] From 137f1eb525e1fff7380bd6ee0332ef9dd89da021 Mon Sep 17 00:00:00 2001 From: eli Date: Mon, 3 Nov 2025 21:50:12 -0600 Subject: [PATCH 08/12] Fix bash test syntax by quoting command substitutions --- test/e2e/test.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/e2e/test.sh b/test/e2e/test.sh index ff5475f..2c8959f 100755 --- a/test/e2e/test.sh +++ b/test/e2e/test.sh @@ -7,7 +7,7 @@ helm test -n opal --logs myopal DATA_URL="http://myopal-opal-client:8181/v1/data" -[ $(kubectl run -n opal curl-test --image=curlimages/curl:latest --rm -i --restart=Never -- curl -s ${DATA_URL}/users) != "{}" ] +[ "$(kubectl run -n opal curl-test --image=curlimages/curl:latest --rm -i --restart=Never -- curl -s ${DATA_URL}/users)" != "{}" ] if [ -z $MSYSTEM ]; then kubectl exec -n opal service/myopal-opal-server -- /opt/e2e/policy-repo-data/upd.sh else @@ -15,5 +15,5 @@ else fi sleep 7 -[ $(kubectl run -n opal curl-test --image=curlimages/curl:latest --rm -i --restart=Never -- curl -s ${DATA_URL}/users) == "{}" ] -[ $(kubectl run -n opal curl-test --image=curlimages/curl:latest --rm -i --restart=Never -- curl -s ${DATA_URL}/losers) != "{}" ] +[ "$(kubectl run -n opal curl-test --image=curlimages/curl:latest --rm -i --restart=Never -- curl -s ${DATA_URL}/users)" == "{}" ] +[ "$(kubectl run -n opal curl-test --image=curlimages/curl:latest --rm -i --restart=Never -- curl -s ${DATA_URL}/losers)" != "{}" ] From b555e692c8a5f4097867e1b3b1a7ef5bb80929a7 Mon Sep 17 00:00:00 2001 From: eli Date: Mon, 3 Nov 2025 21:53:31 -0600 Subject: [PATCH 09/12] Improve e2e test debugging with echo statements --- test/e2e/test.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/test/e2e/test.sh b/test/e2e/test.sh index 2c8959f..5250cfa 100755 --- a/test/e2e/test.sh +++ b/test/e2e/test.sh @@ -7,7 +7,12 @@ helm test -n opal --logs myopal DATA_URL="http://myopal-opal-client:8181/v1/data" -[ "$(kubectl run -n opal curl-test --image=curlimages/curl:latest --rm -i --restart=Never -- curl -s ${DATA_URL}/users)" != "{}" ] +# Check that users data is present initially +RESULT=$(kubectl run -n opal curl-test --image=curlimages/curl:latest --rm -i --restart=Never -- curl -s ${DATA_URL}/users) +echo "Initial users: $RESULT" +[ "$RESULT" != "{}" ] + +# Run the update script if [ -z $MSYSTEM ]; then kubectl exec -n opal service/myopal-opal-server -- /opt/e2e/policy-repo-data/upd.sh else @@ -15,5 +20,13 @@ else fi sleep 7 -[ "$(kubectl run -n opal curl-test --image=curlimages/curl:latest --rm -i --restart=Never -- curl -s ${DATA_URL}/users)" == "{}" ] -[ "$(kubectl run -n opal curl-test --image=curlimages/curl:latest --rm -i --restart=Never -- curl -s ${DATA_URL}/losers)" != "{}" ] + +# Check that users data is empty after update +RESULT=$(kubectl run -n opal curl-test --image=curlimages/curl:latest --rm -i --restart=Never -- curl -s ${DATA_URL}/users) +echo "After update users: $RESULT" +[ "$RESULT" == "{}" ] + +# Check that losers data is present +RESULT=$(kubectl run -n opal curl-test --image=curlimages/curl:latest --rm -i --restart=Never -- curl -s ${DATA_URL}/losers) +echo "Losers data: $RESULT" +[ "$RESULT" != "{}" ] From d24cbd99612fd3508e9fdc404c48f86137536e23 Mon Sep 17 00:00:00 2001 From: eli Date: Mon, 3 Nov 2025 21:56:44 -0600 Subject: [PATCH 10/12] Fix e2e test to match actual OPA response format --- test/e2e/test.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/e2e/test.sh b/test/e2e/test.sh index 5250cfa..ceecbfa 100755 --- a/test/e2e/test.sh +++ b/test/e2e/test.sh @@ -10,7 +10,7 @@ DATA_URL="http://myopal-opal-client:8181/v1/data" # Check that users data is present initially RESULT=$(kubectl run -n opal curl-test --image=curlimages/curl:latest --rm -i --restart=Never -- curl -s ${DATA_URL}/users) echo "Initial users: $RESULT" -[ "$RESULT" != "{}" ] +echo "$RESULT" | grep -q '"result"' # Run the update script if [ -z $MSYSTEM ]; then @@ -21,12 +21,12 @@ fi sleep 7 -# Check that users data is empty after update +# Check that users data is empty after update (should be {"result":{}}) RESULT=$(kubectl run -n opal curl-test --image=curlimages/curl:latest --rm -i --restart=Never -- curl -s ${DATA_URL}/users) echo "After update users: $RESULT" -[ "$RESULT" == "{}" ] +[ "$RESULT" == '{"result":{}}' ] # Check that losers data is present RESULT=$(kubectl run -n opal curl-test --image=curlimages/curl:latest --rm -i --restart=Never -- curl -s ${DATA_URL}/losers) echo "Losers data: $RESULT" -[ "$RESULT" != "{}" ] +echo "$RESULT" | grep -q '"result"' From 0489093b8f0aa2f966184073705e7baee85004b5 Mon Sep 17 00:00:00 2001 From: eli Date: Mon, 3 Nov 2025 22:21:21 -0600 Subject: [PATCH 11/12] Fix e2e test empty data check to match OPA behavior --- test/e2e/test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/test.sh b/test/e2e/test.sh index ceecbfa..abcd35c 100755 --- a/test/e2e/test.sh +++ b/test/e2e/test.sh @@ -21,10 +21,10 @@ fi sleep 7 -# Check that users data is empty after update (should be {"result":{}}) +# Check that users data is empty after update (OPA returns {} when data is empty) RESULT=$(kubectl run -n opal curl-test --image=curlimages/curl:latest --rm -i --restart=Never -- curl -s ${DATA_URL}/users) echo "After update users: $RESULT" -[ "$RESULT" == '{"result":{}}' ] +[ "$RESULT" == '{}' ] # Check that losers data is present RESULT=$(kubectl run -n opal curl-test --image=curlimages/curl:latest --rm -i --restart=Never -- curl -s ${DATA_URL}/losers) From 75300adfb075022485598eb480e69764622c1176 Mon Sep 17 00:00:00 2001 From: eli Date: Mon, 3 Nov 2025 22:24:49 -0600 Subject: [PATCH 12/12] Filter out kubectl pod deletion messages from curl output --- test/e2e/test.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/e2e/test.sh b/test/e2e/test.sh index abcd35c..cfc2413 100755 --- a/test/e2e/test.sh +++ b/test/e2e/test.sh @@ -8,7 +8,7 @@ helm test -n opal --logs myopal DATA_URL="http://myopal-opal-client:8181/v1/data" # Check that users data is present initially -RESULT=$(kubectl run -n opal curl-test --image=curlimages/curl:latest --rm -i --restart=Never -- curl -s ${DATA_URL}/users) +RESULT=$(kubectl run -n opal curl-test --image=curlimages/curl:latest --rm -i --restart=Never -- curl -s ${DATA_URL}/users 2>&1 | grep -v "pod.*deleted") echo "Initial users: $RESULT" echo "$RESULT" | grep -q '"result"' @@ -22,11 +22,11 @@ fi sleep 7 # Check that users data is empty after update (OPA returns {} when data is empty) -RESULT=$(kubectl run -n opal curl-test --image=curlimages/curl:latest --rm -i --restart=Never -- curl -s ${DATA_URL}/users) +RESULT=$(kubectl run -n opal curl-test --image=curlimages/curl:latest --rm -i --restart=Never -- curl -s ${DATA_URL}/users 2>&1 | grep -v "pod.*deleted") echo "After update users: $RESULT" [ "$RESULT" == '{}' ] # Check that losers data is present -RESULT=$(kubectl run -n opal curl-test --image=curlimages/curl:latest --rm -i --restart=Never -- curl -s ${DATA_URL}/losers) +RESULT=$(kubectl run -n opal curl-test --image=curlimages/curl:latest --rm -i --restart=Never -- curl -s ${DATA_URL}/losers 2>&1 | grep -v "pod.*deleted") echo "Losers data: $RESULT" echo "$RESULT" | grep -q '"result"'