From da3f4842209366b96f428eba07cce13ddf415c08 Mon Sep 17 00:00:00 2001 From: kartik-579 Date: Fri, 2 Dec 2022 14:35:08 +0530 Subject: [PATCH 1/2] app clone response update --- pkg/appClone/AppCloneService.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/appClone/AppCloneService.go b/pkg/appClone/AppCloneService.go index 58d7e19ff8..079d5eb4a9 100644 --- a/pkg/appClone/AppCloneService.go +++ b/pkg/appClone/AppCloneService.go @@ -123,7 +123,7 @@ func (impl *AppCloneServiceImpl) CloneApp(createReq *bean.CreateAppDTO, context newAppId := app.Id if !refAppStatus["MATERIAL"] { impl.logger.Errorw("status not", "MATERIAL", cloneReq.RefAppId) - return nil, nil + return app, nil } _, gitMaerialMap, err := impl.CloneGitRepo(cloneReq.RefAppId, newAppId, userId) if err != nil { @@ -138,7 +138,7 @@ func (impl *AppCloneServiceImpl) CloneApp(createReq *bean.CreateAppDTO, context } if !refAppStatus["TEMPLATE"] { impl.logger.Errorw("status not", "TEMPLATE", cloneReq.RefAppId) - return nil, nil + return app, nil } _, err = impl.CreateDeploymentTemplate(cloneReq.RefAppId, newAppId, userId, context) if err != nil { From 04b757bef7e2a8f1df5db9154835a244aaaa1d84 Mon Sep 17 00:00:00 2001 From: kartik-579 Date: Tue, 6 Dec 2022 18:44:18 +0530 Subject: [PATCH 2/2] updated return check for apps where deployment chart is not present --- pkg/appClone/AppCloneService.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/appClone/AppCloneService.go b/pkg/appClone/AppCloneService.go index 079d5eb4a9..0ee0717ee0 100644 --- a/pkg/appClone/AppCloneService.go +++ b/pkg/appClone/AppCloneService.go @@ -140,6 +140,10 @@ func (impl *AppCloneServiceImpl) CloneApp(createReq *bean.CreateAppDTO, context impl.logger.Errorw("status not", "TEMPLATE", cloneReq.RefAppId) return app, nil } + if !refAppStatus["CHART"] { + impl.logger.Errorw("status not", "CHART", cloneReq.RefAppId) + return app, nil + } _, err = impl.CreateDeploymentTemplate(cloneReq.RefAppId, newAppId, userId, context) if err != nil { impl.logger.Errorw("error in creating deployment template", "ref", cloneReq.RefAppId, "new", newAppId, "err", err)