bdoyle0182 commented on a change in pull request #4986:
URL: https://github.com/apache/openwhisk/pull/4986#discussion_r506656713



##########
File path: 
core/controller/src/main/scala/org/apache/openwhisk/core/controller/Actions.scala
##########
@@ -218,9 +229,36 @@ trait WhiskActionsApi extends WhiskCollectionAPI with 
PostActionActivation with
 
         onComplete(checkAdditionalPrivileges) {
           case Success(_) =>
-            putEntity(WhiskAction, entityStore, entityName.toDocId, overwrite, 
update(user, request) _, () => {
-              make(user, entityName, request)
-            })
+            onComplete(WhiskActionVersionList.get(entityName, entityStore)) {
+              case Success(result) =>
+                val id = 
result.matchedDocId(content.version).getOrElse(entityName.toDocId)
+                putEntity(
+                  WhiskAction,
+                  entityStore,
+                  id,
+                  true,
+                  update(user, request) _,
+                  () => {
+                    make(user, entityName, request)
+                  },
+                  postProcess = Some { action: WhiskAction =>
+                    // delete oldest version when created successfully

Review comment:
       Can we have an operator level configuration where if you are at the max 
limit of versions, you either do this delete the oldest version or reject the 
create request and require the user to delete an old version before creating a 
new one?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to