From 381a250d48a08c3cd950da9e187f575c75246fa2 Mon Sep 17 00:00:00 2001 From: Andrew Kennedy Date: Sun, 12 Apr 2015 17:45:19 +0100 Subject: [PATCH] Check for allowed characters in Docker container name --- .../brooklyn/entity/container/docker/DockerContainerImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/src/main/java/brooklyn/entity/container/docker/DockerContainerImpl.java b/docker/src/main/java/brooklyn/entity/container/docker/DockerContainerImpl.java index 6516db3a..351f81ee 100644 --- a/docker/src/main/java/brooklyn/entity/container/docker/DockerContainerImpl.java +++ b/docker/src/main/java/brooklyn/entity/container/docker/DockerContainerImpl.java @@ -48,6 +48,7 @@ import brooklyn.entity.basic.ServiceStateLogic; import brooklyn.entity.basic.SoftwareProcess; import brooklyn.entity.container.DockerAttributes; +import brooklyn.entity.container.DockerUtils; import brooklyn.event.basic.PortAttributeSensorAndConfigKey; import brooklyn.event.basic.Sensors; import brooklyn.event.feed.ConfigToAttributes; @@ -424,7 +425,7 @@ public DockerContainerLocation createLocation(Map flags) { containerName = getAttribute(DOCKER_CONTAINER_NAME); } if (Strings.isNonBlank(containerName)) { - options.nodeNames(ImmutableList.of(containerName)); + options.nodeNames(ImmutableList.of(DockerUtils.allowed(containerName))); } // put these fields on the location so it has the info it needs to create the subnet