Skip to content

Commit

Permalink
added the debugger for flux app listing
Browse files Browse the repository at this point in the history
  • Loading branch information
RajeevRanjan27 committed Jul 5, 2024
1 parent c39c7c6 commit 88e0cc7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/service/HelmAppServiceWrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -596,21 +596,27 @@ 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 {
clusterConfig := *config
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
}

Expand Down
3 changes: 3 additions & 0 deletions pkg/service/fluxService/fluxApplicationService.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 88e0cc7

Please sign in to comment.