From fab70a86b633e3f76a3987ab8da36f1466061308 Mon Sep 17 00:00:00 2001 From: Vasi Vasireddy Date: Fri, 6 Oct 2023 11:24:00 -0700 Subject: [PATCH] Changes to default Test image, Session_token usage, exposed port removal --- .../test/java/software/amazon/adot/testbed/LogsTests.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/adot-testbed/app/src/test/java/software/amazon/adot/testbed/LogsTests.java b/adot-testbed/app/src/test/java/software/amazon/adot/testbed/LogsTests.java index b845b02f8..b69ab043e 100644 --- a/adot-testbed/app/src/test/java/software/amazon/adot/testbed/LogsTests.java +++ b/adot-testbed/app/src/test/java/software/amazon/adot/testbed/LogsTests.java @@ -43,7 +43,7 @@ class LogsTests { private static final String TEST_IMAGE = System.getenv("TEST_IMAGE") != null && !System.getenv("TEST_IMAGE").isEmpty() ? System.getenv("TEST_IMAGE") - : "public.ecr.aws/aws-otel-test/adot-collector-integration-test:latest"; + : "public.ecr.aws/aws-observability/aws-otel-collector:latest"; private final Logger collectorLogger = LoggerFactory.getLogger("collector"); private static final String uniqueID = UUID.randomUUID().toString(); @@ -62,9 +62,12 @@ private GenericContainer createAndStartCollector(String configFilePath, Strin envVariables.put("AWS_ACCESS_KEY_ID", System.getenv("AWS_ACCESS_KEY_ID")); envVariables.put("AWS_SECRET_ACCESS_KEY", System.getenv("AWS_SECRET_ACCESS_KEY")); envVariables.put("AWS_SESSION_TOKEN", System.getenv("AWS_SESSION_TOKEN")); + // Check if AWS_SESSION_TOKEN is not null before adding it + if (System.getenv("AWS_SESSION_TOKEN") != null) { + envVariables.put("AWS_SESSION_TOKEN", System.getenv("AWS_SESSION_TOKEN")); + } var collector = new GenericContainer<>(TEST_IMAGE) - .withExposedPorts(4317) .withCopyFileToContainer(MountableFile.forClasspathResource(configFilePath), "/etc/collector/config.yaml") .withLogConsumer(new Slf4jLogConsumer(collectorLogger)) .waitingFor(Wait.forLogMessage(".*Everything is ready. Begin running and processing data.*", 1))