summaryrefslogtreecommitdiffstats
path: root/src/orchestrator
diff options
context:
space:
mode:
authorAditya Sharoff <aditya.sharoff@intel.com>2020-09-24 15:45:15 -0700
committerAditya Sharoff <aditya.sharoff@intel.com>2020-09-30 10:12:53 -0700
commit0c527d07b604fc9ecad713732c3d9bb5d5ace31e (patch)
tree767613fbfc69bf85174afee62cb33d7410e7337d /src/orchestrator
parentb069e7e63469a34e380e2a139aa2bfeaa9fb4c7f (diff)
delete should return 404 error for invalid name
Issue-ID: MULTICLOUD-1150 Change-Id: I04c9584e35672b6b40047a67be4d2026002204e1 Signed-off-by: Aditya Sharoff <aditya.sharoff@intel.com>
Diffstat (limited to 'src/orchestrator')
-rw-r--r--src/orchestrator/api/composite_app_handler.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/orchestrator/api/composite_app_handler.go b/src/orchestrator/api/composite_app_handler.go
index d531b28d..761d60b9 100644
--- a/src/orchestrator/api/composite_app_handler.go
+++ b/src/orchestrator/api/composite_app_handler.go
@@ -130,7 +130,12 @@ func (h compositeAppHandler) deleteHandler(w http.ResponseWriter, r *http.Reques
version := vars["version"]
projectName := vars["project-name"]
- err := h.client.DeleteCompositeApp(name, version, projectName)
+ _, err := h.client.GetCompositeApp(name, version, projectName)
+ if err != nil {
+ http.Error(w, err.Error(), http.StatusNotFound)
+ return
+ }
+ err = h.client.DeleteCompositeApp(name, version, projectName)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return