This is an automated email from the ASF dual-hosted git repository.
style95 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwhisk.git
The following commit(s) were added to refs/heads/master by this push:
new bfa7702 Remove unused codes (#4906)
bfa7702 is described below
commit bfa7702de342a490e3db1ac09c7331d2d74f2b61
Author: ningyougang <[email protected]>
AuthorDate: Mon Jun 1 10:12:14 2020 +0800
Remove unused codes (#4906)
Co-authored-by: ning.yougang <[email protected]>
---
.../apache/openwhisk/core/controller/Actions.scala | 7 ---
.../core/entity/test/ExecManifestTests.scala | 70 +++++++++++-----------
2 files changed, 35 insertions(+), 42 deletions(-)
diff --git
a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Actions.scala
b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Actions.scala
index bc044f4..056aadf 100644
---
a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Actions.scala
+++
b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Actions.scala
@@ -398,13 +398,6 @@ trait WhiskActionsApi extends WhiskCollectionAPI with
PostActionActivation with
resolvedComponents
}
- /** Replaces default namespaces in an action sequence with appropriate
namespace. */
- private def resolveDefaultNamespace(seq: SequenceExec, user: Identity):
SequenceExec = {
- // if components are part of the default namespace, they contain `_`;
replace it!
- val resolvedComponents = resolveDefaultNamespace(seq.components, user)
- new SequenceExec(resolvedComponents)
- }
-
/**
* Creates a WhiskAction instance from the PUT request.
*/
diff --git
a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecManifestTests.scala
b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecManifestTests.scala
index 874bd11..dcc9077 100644
---
a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecManifestTests.scala
+++
b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecManifestTests.scala
@@ -270,27 +270,27 @@ class ExecManifestTests extends FlatSpec with
WskActorSystem with StreamLogging
|{ "runtimes": {
| "nodef": [
| {
- | "kind": "nodejs:10",
- | "deprecated": true,
+ | "kind": "nodejs:8",
+ | "default": true,
| "image": {
| "name": "nodejsaction"
| },
| "stemCells": [{
| "initialCount": 1,
| "memory": "128 MB"
+ | }, {
+ | "initialCount": 1,
+ | "memory": "256 MB"
| }]
| }, {
- | "kind": "nodejs:8",
- | "default": true,
+ | "kind": "nodejs:10",
+ | "deprecated": true,
| "image": {
| "name": "nodejsaction"
| },
| "stemCells": [{
| "initialCount": 1,
| "memory": "128 MB"
- | }, {
- | "initialCount": 1,
- | "memory": "256 MB"
| }]
| }
| ],
@@ -321,16 +321,16 @@ class ExecManifestTests extends FlatSpec with
WskActorSystem with StreamLogging
|}
|""".stripMargin.parseJson.asJsObject
- val js10 = RuntimeManifest(
- "nodejs:10",
- ImageName("nodejsaction"),
- deprecated = Some(true),
- stemCells = Some(List(StemCell(1, 128.MB))))
val js8 = RuntimeManifest(
"nodejs:8",
ImageName("nodejsaction"),
default = Some(true),
stemCells = Some(List(StemCell(1, 128.MB), StemCell(1, 256.MB))))
+ val js10 = RuntimeManifest(
+ "nodejs:10",
+ ImageName("nodejsaction"),
+ deprecated = Some(true),
+ stemCells = Some(List(StemCell(1, 128.MB))))
val py = RuntimeManifest("python", ImageName("pythonaction"), stemCells =
Some(List(StemCell(2, 256.MB))))
val sw = RuntimeManifest("swift", ImageName("swiftaction"), stemCells =
Some(List.empty))
val ph = RuntimeManifest("php", ImageName("phpaction"))
@@ -339,7 +339,7 @@ class ExecManifestTests extends FlatSpec with
WskActorSystem with StreamLogging
mf shouldBe {
Runtimes(
Set(
- RuntimeFamily("nodef", Set(js10, js8)),
+ RuntimeFamily("nodef", Set(js8, js10)),
RuntimeFamily("pythonf", Set(py)),
RuntimeFamily("swiftf", Set(sw)),
RuntimeFamily("phpf", Set(ph))),
@@ -353,9 +353,9 @@ class ExecManifestTests extends FlatSpec with
WskActorSystem with StreamLogging
(m.kind, m.image, c.initialCount, c.memory)
}
}.toList should contain theSameElementsAs List(
- (js10.kind, js10.image, 1, 128.MB),
(js8.kind, js8.image, 1, 128.MB),
(js8.kind, js8.image, 1, 256.MB),
+ (js10.kind, js10.image, 1, 128.MB),
(py.kind, py.image, 2, 256.MB))
}
@@ -364,8 +364,8 @@ class ExecManifestTests extends FlatSpec with
WskActorSystem with StreamLogging
|{ "runtimes": {
| "nodef": [
| {
- | "kind": "nodejs:10",
- | "deprecated": true,
+ | "kind": "nodejs:8",
+ | "default": true,
| "image": {
| "name": "nodejsaction"
| },
@@ -378,11 +378,21 @@ class ExecManifestTests extends FlatSpec with
WskActorSystem with StreamLogging
| "ttl": "2 minutes",
| "threshold": 1,
| "increment": 1
+ | }
+ | }, {
+ | "initialCount": 1,
+ | "memory": "256 MB",
+ | "reactive": {
+ | "minCount": 1,
+ | "maxCount": 4,
+ | "ttl": "2 minutes",
+ | "threshold": 1,
+ | "increment": 1
| }
| }]
| }, {
- | "kind": "nodejs:8",
- | "default": true,
+ | "kind": "nodejs:10",
+ | "deprecated": true,
| "image": {
| "name": "nodejsaction"
| },
@@ -395,16 +405,6 @@ class ExecManifestTests extends FlatSpec with
WskActorSystem with StreamLogging
| "ttl": "2 minutes",
| "threshold": 1,
| "increment": 1
- | }
- | }, {
- | "initialCount": 1,
- | "memory": "256 MB",
- | "reactive": {
- | "minCount": 1,
- | "maxCount": 4,
- | "ttl": "2 minutes",
- | "threshold": 1,
- | "increment": 1
| }
| }]
| }
@@ -444,16 +444,16 @@ class ExecManifestTests extends FlatSpec with
WskActorSystem with StreamLogging
|""".stripMargin.parseJson.asJsObject
val reactive = Some(ReactivePrewarmingConfig(1, 4, FiniteDuration(2,
TimeUnit.MINUTES), 1, 1))
- val js10 = RuntimeManifest(
- "nodejs:10",
- ImageName("nodejsaction"),
- deprecated = Some(true),
- stemCells = Some(List(StemCell(1, 128.MB, reactive))))
val js8 = RuntimeManifest(
"nodejs:8",
ImageName("nodejsaction"),
default = Some(true),
stemCells = Some(List(StemCell(1, 128.MB, reactive), StemCell(1, 256.MB,
reactive))))
+ val js10 = RuntimeManifest(
+ "nodejs:10",
+ ImageName("nodejsaction"),
+ deprecated = Some(true),
+ stemCells = Some(List(StemCell(1, 128.MB, reactive))))
val py = RuntimeManifest("python", ImageName("pythonaction"), stemCells =
Some(List(StemCell(2, 256.MB, reactive))))
val sw = RuntimeManifest("swift", ImageName("swiftaction"), stemCells =
Some(List.empty))
val ph = RuntimeManifest("php", ImageName("phpaction"))
@@ -462,7 +462,7 @@ class ExecManifestTests extends FlatSpec with
WskActorSystem with StreamLogging
mf shouldBe {
Runtimes(
Set(
- RuntimeFamily("nodef", Set(js10, js8)),
+ RuntimeFamily("nodef", Set(js8, js10)),
RuntimeFamily("pythonf", Set(py)),
RuntimeFamily("swiftf", Set(sw)),
RuntimeFamily("phpf", Set(ph))),
@@ -476,9 +476,9 @@ class ExecManifestTests extends FlatSpec with
WskActorSystem with StreamLogging
(m.kind, m.image, c.initialCount, c.memory)
}
}.toList should contain theSameElementsAs List(
- (js10.kind, js10.image, 1, 128.MB),
(js8.kind, js8.image, 1, 128.MB),
(js8.kind, js8.image, 1, 256.MB),
+ (js10.kind, js10.image, 1, 128.MB),
(py.kind, py.image, 2, 256.MB))
}
}