csantanapr closed pull request #3318: Remove restriction on updating a trigger 
with a new feed.
URL: https://github.com/apache/incubator-openwhisk/pull/3318
 
 
   

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/core/controller/src/main/scala/whisk/core/controller/Triggers.scala 
b/core/controller/src/main/scala/whisk/core/controller/Triggers.scala
index 8302d74db6..7a2428675f 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 fdfcf4f71b..44ab26b92a 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)
     }
   }
 


 

----------------------------------------------------------------
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

Reply via email to