From e8625efbf1b8a8174f67e39b2b9433ddb851f84b Mon Sep 17 00:00:00 2001 From: ShashwatDadhich Date: Thu, 25 Apr 2024 11:55:38 +0530 Subject: [PATCH 1/2] fixed --- api/restHandler/app/appList/AppListingRestHandler.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/restHandler/app/appList/AppListingRestHandler.go b/api/restHandler/app/appList/AppListingRestHandler.go index 373f14bf85..9d1ce288cd 100644 --- a/api/restHandler/app/appList/AppListingRestHandler.go +++ b/api/restHandler/app/appList/AppListingRestHandler.go @@ -980,6 +980,10 @@ func (handler AppListingRestHandlerImpl) getAppDetails(ctx context.Context, appI // TODO: move this to service func (handler AppListingRestHandlerImpl) fetchResourceTree(w http.ResponseWriter, r *http.Request, appId int, envId int, acdToken string, cdPipeline *pipelineConfig.Pipeline) (map[string]interface{}, error) { var resourceTree map[string]interface{} + if !cdPipeline.DeploymentAppCreated { + handler.logger.Infow("deployment for this pipeline does not exist") + return resourceTree, nil + } if len(cdPipeline.DeploymentAppName) > 0 && cdPipeline.EnvironmentId > 0 && util.IsAcdApp(cdPipeline.DeploymentAppType) { // RBAC enforcer Ends query := &application2.ResourcesQuery{ From 223a52573e44579f2657220633d3f051e7aff755 Mon Sep 17 00:00:00 2001 From: ShashwatDadhich Date: Thu, 25 Apr 2024 12:46:56 +0530 Subject: [PATCH 2/2] code review comments --- api/restHandler/app/appList/AppListingRestHandler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/restHandler/app/appList/AppListingRestHandler.go b/api/restHandler/app/appList/AppListingRestHandler.go index 9d1ce288cd..a0330f4104 100644 --- a/api/restHandler/app/appList/AppListingRestHandler.go +++ b/api/restHandler/app/appList/AppListingRestHandler.go @@ -981,7 +981,7 @@ func (handler AppListingRestHandlerImpl) getAppDetails(ctx context.Context, appI func (handler AppListingRestHandlerImpl) fetchResourceTree(w http.ResponseWriter, r *http.Request, appId int, envId int, acdToken string, cdPipeline *pipelineConfig.Pipeline) (map[string]interface{}, error) { var resourceTree map[string]interface{} if !cdPipeline.DeploymentAppCreated { - handler.logger.Infow("deployment for this pipeline does not exist") + handler.logger.Infow("deployment for this pipeline does not exist", "pipelineId", cdPipeline.Id) return resourceTree, nil } if len(cdPipeline.DeploymentAppName) > 0 && cdPipeline.EnvironmentId > 0 && util.IsAcdApp(cdPipeline.DeploymentAppType) {