Skip to content

Commit

Permalink
Changes to default Test image, Session_token usage, exposed port removal
Browse files Browse the repository at this point in the history
  • Loading branch information
vasireddy99 committed Oct 6, 2023
1 parent 6a6cd38 commit fab70a8
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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))
Expand Down

0 comments on commit fab70a8

Please sign in to comment.