Skip to content

Commit

Permalink
Make key names consistent with prior resources.
Browse files Browse the repository at this point in the history
  • Loading branch information
whitingjr committed Sep 18, 2024
1 parent 1131f36 commit bcdaf46
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ public class Const {
public static final String HORREUM_DEV_AMQP_ENABLED = "horreum.dev-services.amqp.enabled";
public static final String HORREUM_DEV_AMQP_IMAGE = "horreum.dev-services.amqp.image";
public static final String HORREUM_DEV_AMQP_NETWORK_ALIAS = "horreum.dev-services.amqp.network-alias";
public static final String HORREUM_DEV_AMQP_MAPPED_PORT = "horreum.dev-services.amqp.mapped.port";
public static final String HORREUM_DEV_AMQP_MAPPED_HOST = "horreum.dev-services.amqp.mapped.host";

public static final String DEFAULT_DB_USERNAME = "dbadmin";
public static final String DEFAULT_DB_PASSWORD = "secret";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public Map<String, String> start(Optional<Network> network) {
String mappedPort = amqpContainer.getMappedPort(5672).toString();
String host = inContainer ? networkAlias : "localhost";

return Map.of(HORREUM_DEV_AMQP_MAPPED_PORT, mappedPort,
HORREUM_DEV_AMQP_MAPPED_HOST, host);
return Map.of("artemis.container.name", host,
"artemis.container.port", mappedPort);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
public class HorreumResource implements ResourceLifecycleManager {

private static GenericContainer<?> horreumContainer;
private StringBuilder javaOptions = new StringBuilder();
private boolean inContainer = false;

private String networkAlias = "";

Expand All @@ -27,6 +27,7 @@ public void init(Map<String, String> initArgs) {

final String HORREUM_IMAGE = initArgs.get(HORREUM_DEV_HORREUM_HORREUM_IMAGE);

inContainer = initArgs.containsKey("inContainer") && initArgs.get("inContainer").equals("true");
networkAlias = initArgs.get(HORREUM_DEV_HORREUM_NETWORK_ALIAS);
Network network = HorreumResources.getNetwork();

Expand Down Expand Up @@ -86,6 +87,7 @@ public Map<String, String> start(Optional<Network> network) {

horreumContainer.start();
String horreumContainerName = horreumContainer.getContainerName().replaceAll("/", "");
horreumContainerName = inContainer ? networkAlias : horreumContainerName;
Integer port = horreumContainer.getMappedPort(8080);

return Map.of("horreum.container.name", horreumContainerName,
Expand Down

0 comments on commit bcdaf46

Please sign in to comment.