chetanmeh commented on a change in pull request #4503: Add option for appending 
runtimes registry to user provided images
URL: 
https://github.com/apache/incubator-openwhisk/pull/4503#discussion_r291155151
 
 

 ##########
 File path: 
common/scala/src/main/scala/org/apache/openwhisk/core/mesos/MesosContainerFactory.scala
 ##########
 @@ -126,7 +126,7 @@ class MesosContainerFactory(config: WhiskConfig,
                                memory: ByteSize,
                                cpuShares: Int)(implicit config: WhiskConfig, 
logging: Logging): Future[Container] = {
     implicit val transid = tid
-    val image = if (userProvidedImage) {
+    val image = if (userProvidedImage && 
!runtimesRegistryConfig.includeUserImages.getOrElse(false)) {
 
 Review comment:
   This pattern is repeating itself in 4 impls so far. May be we should move 
this logic to `ContainerFactory` object. Or introduce a new `RuntimesRegistry` 
object and use that 
   
   ```scala
   object RuntimesRegistry {
     def resolveImage(actionImage: ExecManifest.ImageName,
                      userProvidedImage: Boolean,
                      config: RuntimesRegistryConfig): 
Either[ExecManifest.ImageName, String] = {
       if (userProvidedImage && !config.includeUserImages.getOrElse(false)) {
         Left(actionImage)
       } else {
         Right(actionImage.localImageName(config.url))
       }
     }
   }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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

Reply via email to