Explorar o código

change existing app check

Ian Edwards %!s(int64=2) %!d(string=hai) anos
pai
achega
f56dd70d99
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      api/server/handlers/porter_app/create.go

+ 3 - 2
api/server/handlers/porter_app/create.go

@@ -264,8 +264,9 @@ func (c *CreatePorterAppHandler) ServeHTTP(w http.ResponseWriter, r *http.Reques
 			c.HandleAPIError(w, r, apierrors.NewErrPassThroughToClient(err, http.StatusInternalServerError))
 			return
 		}
-		
-		if existing != nil && request.EnvironmentConfigID == 0 {
+
+		// asssuming that namespace not being set means the app is running in production env
+		if existing != nil && request.Namespace == "" {
 			err = telemetry.Error(ctx, span, err, "app with name already exists in environment")
 			c.HandleAPIError(w, r, apierrors.NewErrPassThroughToClient(err, http.StatusForbidden))
 			return