openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From csantan...@apache.org
Subject [incubator-openwhisk] branch master updated: Remove restriction on updating a trigger with a new feed. (#3318)
Date Sat, 24 Feb 2018 05:14:06 GMT
This is an automated email from the ASF dual-hosted git repository.

csantanapr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new febd093  Remove restriction on updating a trigger with a new feed. (#3318)
febd093 is described below

commit febd093771b89e911c38eb86100e60d71c4ab31f
Author: rodric rabbah <rodric@gmail.com>
AuthorDate: Sat Feb 24 00:14:03 2018 -0500

    Remove restriction on updating a trigger with a new feed. (#3318)
---
 .../src/main/scala/whisk/core/controller/Triggers.scala        | 10 +---------
 .../scala/whisk/core/controller/test/TriggersApiTests.scala    |  6 ++++--
 2 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/core/controller/src/main/scala/whisk/core/controller/Triggers.scala b/core/controller/src/main/scala/whisk/core/controller/Triggers.scala
index 8302d74..7a24286 100644
--- a/core/controller/src/main/scala/whisk/core/controller/Triggers.scala
+++ b/core/controller/src/main/scala/whisk/core/controller/Triggers.scala
@@ -245,15 +245,7 @@ trait WhiskTriggersApi extends WhiskCollectionAPI {
       content.publish getOrElse trigger.publish,
       content.annotations getOrElse trigger.annotations,
       trigger.rules).revision[WhiskTrigger](trigger.docinfo.rev)
-
-    // feed must be specified in create, and cannot be added as a trigger update
-    content.annotations flatMap { _.get(Parameters.Feed) } map { _ =>
-      Future failed {
-        RejectRequest(BadRequest, "A trigger feed is only permitted when the trigger is created")
-      }
-    } getOrElse {
-      Future successful newTrigger
-    }
+    Future.successful(newTrigger)
   }
 
   /**
diff --git a/tests/src/test/scala/whisk/core/controller/test/TriggersApiTests.scala b/tests/src/test/scala/whisk/core/controller/test/TriggersApiTests.scala
index fdfcf4f..44ab26b 100644
--- a/tests/src/test/scala/whisk/core/controller/test/TriggersApiTests.scala
+++ b/tests/src/test/scala/whisk/core/controller/test/TriggersApiTests.scala
@@ -303,7 +303,8 @@ class TriggersApiTests extends ControllerTestCommon with WhiskTriggersApi
{
     val content = WhiskTriggerPut(annotations = Some(trigger.annotations))
     put(entityStore, trigger)
     Put(s"$collectionPath/${trigger.name}?overwrite=true", content) ~> Route.seal(routes(creds))
~> check {
-      status should be(BadRequest)
+      deleteTrigger(trigger.docid)
+      status should be(OK)
     }
   }
 
@@ -313,7 +314,8 @@ class TriggersApiTests extends ControllerTestCommon with WhiskTriggersApi
{
     val content = WhiskTriggerPut(annotations = Some(Parameters(Parameters.Feed, "xyz")))
     put(entityStore, trigger)
     Put(s"$collectionPath/${trigger.name}?overwrite=true", content) ~> Route.seal(routes(creds))
~> check {
-      status should be(BadRequest)
+      deleteTrigger(trigger.docid)
+      status should be(OK)
     }
   }
 

-- 
To stop receiving notification emails like this one, please contact
csantanapr@apache.org.

Mime
View raw message