@Override public Map<String, Node> parse() { Map<String, Node> nodes = new HashMap<>(); Set<String> networksIds = this.containerDefinition.getNetworkIds(); for (Map.Entry<String, CubeContainer> container : this.containerDefinition.getNoneManualContainers().entrySet()) { // If cube is not named as the deployable container (this is done in this way because containers that are named as the deployable container are started by another process). if (!this.deployableContainers.contains(container.getKey())) { final String networkMode = container.getValue().getNetworkMode(); if (networkMode != null) { // if the network that this cube must connect is registered in current cube definition if (networksIds.contains(networkMode)) { String name = container.getKey(); Node child = Node.from(name); nodes.put(name, child); } } } } return nodes; } }
@Override public Map<String, Node> parse() { Map<String, Node> nodes = new HashMap<>(); Set<String> networksIds = this.containerDefinition.getNetworkIds(); for (Map.Entry<String, CubeContainer> container : this.containerDefinition.getNoneManualContainers().entrySet()) { // If cube is not named as the deployable container (this is done in this way because containers that are named as the deployable container are started by another process). if (!this.deployableContainers.contains(container.getKey())) { final String networkMode = container.getValue().getNetworkMode(); if (networkMode != null) { // if the network that this cube must connect is registered in current cube definition if (networksIds.contains(networkMode)) { String name = container.getKey(); Node child = Node.from(name); nodes.put(name, child); } } } } return nodes; } }
private AutoStartParser resolveNotSetAutoStart(ContainerRegistry containerRegistry, DockerCompositions containers) { //we want to use the automatic autoconfiguration List<String> containersName = toContainersName(containerRegistry.getContainers()); if (containers.getNetworkIds().size() > 0) { //if network defined then you should not mix links and network return new AutomaticResolutionNetworkAutoStartParser(containersName, containers); } else { // if no network defined then links approach is used. return new AutomaticResolutionLinksAutoStartParser(containersName, containers); } } }
private AutoStartParser resolveNotSetAutoStart(ContainerRegistry containerRegistry, DockerCompositions containers) { //we want to use the automatic autoconfiguration List<String> containersName = toContainersName(containerRegistry.getContainers()); if (containers.getNetworkIds().size() > 0) { //if network defined then you should not mix links and network return new AutomaticResolutionNetworkAutoStartParser(containersName, containers); } else { // if no network defined then links approach is used. return new AutomaticResolutionLinksAutoStartParser(containersName, containers); } } }
final Set<String> networkIds = dockerContainersContent.getNetworkIds(); String network1 = findElementStartingWith(networkIds, "network1"); assertThat(network1, is(not("network1*")));