From 88e0cc7aef755724b51d8428e1993951a6afd281 Mon Sep 17 00:00:00 2001 From: Rajeev Devtron Date: Fri, 5 Jul 2024 12:05:35 +0530 Subject: [PATCH] added the debugger for flux app listing --- pkg/service/HelmAppServiceWrapper.go | 6 ++++++ pkg/service/fluxService/fluxApplicationService.go | 3 +++ 2 files changed, 9 insertions(+) diff --git a/pkg/service/HelmAppServiceWrapper.go b/pkg/service/HelmAppServiceWrapper.go index f50196f4d..950518737 100644 --- a/pkg/service/HelmAppServiceWrapper.go +++ b/pkg/service/HelmAppServiceWrapper.go @@ -596,6 +596,8 @@ func (impl *ApplicationServiceServerImpl) PushHelmChartToOCIRegistry(ctx context func (impl *ApplicationServiceServerImpl) ListFluxApplications(req *client.AppListRequest, res client.ApplicationService_ListFluxApplicationsServer) error { impl.Logger.Infow("List Flux Application Request", "req", req) + impl.Logger.Debugw("List Flux Application Request received in kubelink ", "req", req) + clusterConfigs := req.GetClusters() eg := new(errgroup.Group) for _, config := range clusterConfigs { @@ -603,14 +605,18 @@ func (impl *ApplicationServiceServerImpl) ListFluxApplications(req *client.AppLi eg.Go(func() error { apps := impl.FluxAppService.GetFluxApplicationListForCluster(&clusterConfig) err := res.Send(apps) + impl.Logger.Debugw("List Flux Application Request served having the list", "apps", apps) return err }) } if err := eg.Wait(); err != nil { + impl.Logger.Debugw("Error in fetching application list", "err", err) impl.Logger.Errorw("Error in fetching application list", "err", err) return err } impl.Logger.Info("List Flux Application Request served") + impl.Logger.Debugw("List Flux Application Request served") + return nil } diff --git a/pkg/service/fluxService/fluxApplicationService.go b/pkg/service/fluxService/fluxApplicationService.go index fdf70a21f..967e5ec0a 100644 --- a/pkg/service/fluxService/fluxApplicationService.go +++ b/pkg/service/fluxService/fluxApplicationService.go @@ -50,10 +50,13 @@ func (impl *FluxApplicationServiceImpl) GetFluxApplicationListForCluster(config restConfig, err := impl.k8sUtil.GetRestConfigByCluster(k8sClusterConfig) if err != nil { impl.logger.Errorw("Error in building rest config ", "clusterId", config.ClusterId, "err", err) + impl.logger.Debugw("Error in building rest config ", "clusterId", config.ClusterId, "err", err) + deployedApp.Errored = true deployedApp.ErrorMsg = err.Error() return deployedApp } + //restConf := *restConfig kustomizationListResp, helmReleaseListResp, err := impl.fetchFluxK8sResponseLists(restConfig) if err != nil && kustomizationListResp == nil {