Skip to content

Commit 3ead6b0

Browse files
committed
add jwt fix
1 parent 955da28 commit 3ead6b0

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ jobs:
366366
CONTAINER_NGINX_IMAGE_REGISTRY="docker-registry.nginx.com" \
367367
TAG="${{ matrix.container.version }}-${{ matrix.container.image }}" \
368368
OS_RELEASE="${{ matrix.container.release }}" OS_VERSION="${{ matrix.container.version }}" \
369-
make official-image-metrics-test | tee ${{github.workspace}}/test/dashboard/logs/${{github.job}}/${{matrix.container.image}}-${{matrix.container.version}}/raw_logs.log
369+
make metrics-test | tee ${{github.workspace}}/test/dashboard/logs/${{github.job}}/${{matrix.container.image}}-${{matrix.container.version}}/raw_logs.log
370370
exit "${PIPESTATUS[0]}"
371371
372372
- name: Format Results
@@ -434,7 +434,7 @@ jobs:
434434
TAG="${{ matrix.container.plus }}-${{ matrix.container.image }}-${{ matrix.container.version }}" \
435435
OS_RELEASE="${{ matrix.container.release }}" OS_VERSION="${{ matrix.container.version }}" IMAGE_PATH="${{ matrix.container.path }}" \
436436
NGINX_LICENSE_JWT="${{ secrets.TEST_JWT }}" \
437-
make official-image-metrics-test | tee ${{github.workspace}}/test/dashboard/logs/${{github.job}}/${{matrix.container.image}}-${{matrix.container.version}}/raw_logs.log
437+
make metrics-test | tee ${{github.workspace}}/test/dashboard/logs/${{github.job}}/${{matrix.container.image}}-${{matrix.container.version}}/raw_logs.log
438438
exit "${PIPESTATUS[0]}"
439439
440440
- name: Format Results

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ official-image-integration-test: $(SELECTED_PACKAGE) build-mock-management-plane
179179
OS_VERSION=$(OS_VERSION) OS_RELEASE=$(OS_RELEASE) IMAGE_PATH=$(IMAGE_PATH) \
180180
go test -v ./test/integration/managementplane ./test/integration/auxiliarycommandserver
181181

182-
official-image-metrics-test: $(SELECTED_PACKAGE) build-mock-management-otel-collector
182+
metrics-test: $(SELECTED_PACKAGE) build-mock-management-otel-collector
183183
TEST_ENV="Container" CONTAINER_OS_TYPE=$(CONTAINER_OS_TYPE) CONTAINER_NGINX_IMAGE_REGISTRY=${CONTAINER_NGINX_IMAGE_REGISTRY} BUILD_TARGET="install" \
184184
PACKAGES_REPO=$(OSS_PACKAGES_REPO) TAG=${TAG} PACKAGE_NAME=$(PACKAGE_NAME) BASE_IMAGE=$(BASE_IMAGE) DOCKERFILE_PATH=$(OFFICIAL_IMAGE_DOCKERFILE_PATH) \
185185
OS_VERSION=$(OS_VERSION) OS_RELEASE=$(OS_RELEASE) IMAGE_PATH=$(IMAGE_PATH) \

test/helpers/test_containers_utils.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package helpers
88
import (
99
"context"
1010
"io"
11+
"os"
1112
"testing"
1213

1314
"github.com/docker/docker/api/types"
@@ -50,6 +51,14 @@ func StartContainer(
5051
tag := Env(tb, "TAG")
5152
imagePath := Env(tb, "IMAGE_PATH")
5253

54+
var env map[string]string
55+
if os.Getenv("NGINX_LICENSE_JWT") != "" {
56+
nginxLicenseJwt := os.Getenv("NGINX_LICENSE_JWT")
57+
env = map[string]string{
58+
"NGINX_LICENSE_JWT": nginxLicenseJwt,
59+
}
60+
}
61+
5362
req := testcontainers.ContainerRequest{
5463
FromDockerfile: testcontainers.FromDockerfile{
5564
Context: "../../../",
@@ -98,6 +107,7 @@ func StartContainer(
98107
FileMode: configFilePermissions,
99108
},
100109
},
110+
Env: env,
101111
}
102112

103113
container, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{

0 commit comments

Comments
 (0)