From e31d6fae1a1b4ad815cb188429bbf57c1c6fbb90 Mon Sep 17 00:00:00 2001 From: Andrew Minkin Date: Wed, 20 Sep 2023 01:25:49 +0600 Subject: [PATCH] EVEREST-256 validate on update --- api/database_cluster.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/database_cluster.go b/api/database_cluster.go index 6f0e1787..8f13ace1 100644 --- a/api/database_cluster.go +++ b/api/database_cluster.go @@ -134,6 +134,10 @@ func (e *EverestServer) UpdateDatabaseCluster(ctx echo.Context, kubernetesID str }) } + if err := e.validateDatabaseClusterCR(ctx, kubernetesID, dbc); err != nil { + return ctx.JSON(http.StatusBadRequest, Error{Message: pointer.ToString(err.Error())}) + } + _, kubeClient, code, err := e.initKubeClient(ctx.Request().Context(), kubernetesID) if err != nil { return ctx.JSON(code, Error{Message: pointer.ToString(err.Error())})