csantanapr closed pull request #3328: Fix oversight in resolving /_ to namespace. URL: https://github.com/apache/incubator-openwhisk/pull/3328
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/common/scala/src/main/scala/whisk/core/entity/FullyQualifiedEntityName.scala b/common/scala/src/main/scala/whisk/core/entity/FullyQualifiedEntityName.scala index 0abca406e2..009e882ea0 100644 --- a/common/scala/src/main/scala/whisk/core/entity/FullyQualifiedEntityName.scala +++ b/common/scala/src/main/scala/whisk/core/entity/FullyQualifiedEntityName.scala @@ -124,7 +124,7 @@ protected[core] object FullyQualifiedEntityName extends DefaultJsonProtocol { else if (leadingSlash || n == 3) Some(path) else Some(namespace.toPath.addPath(path)) } - .map(_.toFullyQualifiedEntityName) + .map(_.resolveNamespace(namespace).toFullyQualifiedEntityName) case _ => None } } diff --git a/tests/src/test/scala/whisk/core/entity/test/SchemaTests.scala b/tests/src/test/scala/whisk/core/entity/test/SchemaTests.scala index b7bfb14c52..b5cb9f4014 100644 --- a/tests/src/test/scala/whisk/core/entity/test/SchemaTests.scala +++ b/tests/src/test/scala/whisk/core/entity/test/SchemaTests.scala @@ -326,6 +326,15 @@ class SchemaTests extends FlatSpec with BeforeAndAfter with ExecHelpers with Mat FullyQualifiedEntityName.resolveName(JsString("a"), EntityName("ns")) shouldBe Some( EntityPath("ns/a").toFullyQualifiedEntityName) + FullyQualifiedEntityName.resolveName(JsString("/_/a"), EntityName("ns")) shouldBe Some( + EntityPath("ns/a").toFullyQualifiedEntityName) + + FullyQualifiedEntityName.resolveName(JsString("_/a"), EntityName("ns")) shouldBe Some( + EntityPath("ns/_/a").toFullyQualifiedEntityName) + + FullyQualifiedEntityName.resolveName(JsString("/_/a/b"), EntityName("ns")) shouldBe Some( + EntityPath("ns/a/b").toFullyQualifiedEntityName) + FullyQualifiedEntityName.resolveName(JsString("a/b"), EntityName("ns")) shouldBe Some( EntityPath("ns/a/b").toFullyQualifiedEntityName) ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services