Skip to content

Commit d5b6569

Browse files
committed
Fix build error
1 parent d7de6e5 commit d5b6569

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

common/scala/src/main/scala/org/apache/openwhisk/core/entity/ActivationResult.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ protected[core] object ActivationResponse extends DefaultJsonProtocol {
229229
// Any non-200 code is treated as a container failure. We still need to check whether
230230
// there was a useful error message in there.
231231
val errorContent = invalidRunResponse(str).toJson
232-
developerErrorWithLog(errorContent, sizeOpt, None)
232+
//developerErrorWithLog(errorContent, sizeOpt, None)
233+
developerError(errorContent, sizeOpt)
233234
}
234235

235236
case scala.util.Success(notAnObj) =>

core/controller/src/main/scala/org/apache/openwhisk/core/controller/actions/PrimitiveActions.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ protected[actions] trait PrimitiveActions {
173173
val startLoadbalancer =
174174
transid.started(this, LoggingMarkers.CONTROLLER_LOADBALANCER, s"action activation id: ${activationId}")
175175

176+
val keySet = payload match {
177+
case Some(JsObject(fields)) => Some(fields.keySet)
178+
case _ => None
179+
}
176180
val message = ActivationMessage(
177181
transid,
178182
FullyQualifiedEntityName(action.namespace, action.name, Some(action.version), action.binding),
@@ -183,7 +187,7 @@ protected[actions] trait PrimitiveActions {
183187
waitForResponse.isDefined,
184188
args,
185189
action.parameters.initParameters,
186-
action.parameters.lockedParameters(payload.map(_.fields.keySet).getOrElse(Set.empty)),
190+
action.parameters.lockedParameters(keySet.getOrElse(Set.empty)),
187191
cause = cause,
188192
WhiskTracerProvider.tracer.getTraceContext(transid))
189193

core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerProxy.scala

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,15 +1093,17 @@ object ContainerProxy {
10931093
}
10941094
}
10951095

1096-
def unlockArguments(content: Option[JsObject],
1096+
def unlockArguments(content: Option[JsValue],
10971097
lockedArgs: Map[String, String],
1098-
decoder: ParameterEncryption): Option[JsObject] = {
1099-
content.map {
1100-
case JsObject(fields) =>
1101-
JsObject(fields.map {
1098+
decoder: ParameterEncryption): Option[JsValue] = {
1099+
content match {
1100+
case Some(JsObject(fields)) =>
1101+
Some(JsObject(fields.map {
11021102
case (k, v: JsString) if lockedArgs.contains(k) => (k -> decoder.encryptor(lockedArgs(k)).decrypt(v))
11031103
case p => p
1104-
})
1104+
}))
1105+
// keep the original for other type(e.g. JsArray)
1106+
case contentValue => contentValue
11051107
}
11061108
}
11071109
}

0 commit comments

Comments
 (0)