Skip to content

Commit

Permalink
fix(): Cleanup logs
Browse files Browse the repository at this point in the history
Signed-off-by: Bharath Horatti <[email protected]>
  • Loading branch information
bharath-avesha committed Oct 6, 2023
1 parent bd5bcd6 commit bc1ebb7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions controllers/slice/slice_gw_edge.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ func allPortsAccountedInEdgeSvc(gwEdgeSvc *corev1.Service, portmap *map[string]i

func (r *SliceReconciler) reconcileSliceGatewayEdgeService(ctx context.Context, slice *kubeslicev1beta1.Slice) (ctrl.Result, error, bool) {
log := r.Log.WithValues("slice", slice.Name)
debugLog := log.V(1)
sliceGwSvcList, err := controllers.GetSliceGwServices(ctx, r.Client, slice.Name)
if err != nil {
return ctrl.Result{}, err, true
Expand All @@ -139,7 +140,7 @@ func (r *SliceReconciler) reconcileSliceGatewayEdgeService(ctx context.Context,
portmap[sliceGwSvc.Name] = sliceGwSvc.Spec.Ports[0].NodePort
}

log.Info("BBH: portmap from slicegw svcs", "portmap", portmap)
debugLog.Info("portmap from slicegw svcs", "portmap", portmap)

gwEdgeSvc, err := r.getSliceGatewayEdgeServices(ctx, slice)
if err != nil {
Expand All @@ -166,7 +167,7 @@ func (r *SliceReconciler) reconcileSliceGatewayEdgeService(ctx context.Context,
// Check if update is needed
if !allPortsAccountedInEdgeSvc(&gwEdgeSvc.Items[0], &portmap) {
gwEdgeSvc.Items[0].Spec.Ports = *getPortListForEdgeSvc(&portmap)
log.Info("BBH: updating edge svc", "updated port list", gwEdgeSvc.Items[0].Spec.Ports)
log.Info("Updating edge svc", "updated port list", gwEdgeSvc.Items[0].Spec.Ports)
err := r.Update(ctx, &gwEdgeSvc.Items[0])
if err != nil {
return ctrl.Result{}, err, true
Expand Down Expand Up @@ -335,8 +336,6 @@ func (r *SliceReconciler) syncSliceGwServiceMap(ctx context.Context, slice *kube
svcmap.SliceGwServiceList = append(svcmap.SliceGwServiceList, &sliceGwSvcInstance.SliceGwServiceInfo)
}

log.Info("BBH: sending svcmap", "slicegwsvc", svcmap)

for _, edgePod := range *gwEdgePodList {
grpcAddress := edgePod.Status.PodIP + ":5000"
_, err := r.WorkerGatewayEdgeClient.UpdateSliceGwServiceMap(ctx, grpcAddress, &svcmap)
Expand Down

0 comments on commit bc1ebb7

Please sign in to comment.