rabbah commented on a change in pull request #3215: adding namePrefix config to
ContainerArgsConfig
URL:
https://github.com/apache/incubator-openwhisk/pull/3215#discussion_r163698889
##########
File path:
common/scala/src/main/scala/whisk/core/containerpool/ContainerFactory.scala
##########
@@ -50,6 +50,15 @@ trait ContainerFactory {
def cleanup(): Unit
}
+object ContainerFactory {
+
+ /** include the instance name, if specified and strip invalid chars before
attempting to use them in the container name */
+ def containerNamePrefix(instanceId: InstanceId): String =
+ s"wsk${instanceId.name.getOrElse("")}${instanceId.toInt}"
+ .replaceAll("[^a-zA-Z0-9_\\.\\-]", "") // based on
https://github.com/moby/moby/issues/3138 and
https://github.com/moby/moby/blob/master/daemon/names/names.go
Review comment:
Since there?s a replace all subsequently should we remove this and trust the
invariant is asserted elsewhere?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services