Skip to content

Commit

Permalink
MESH-0000: Enhance logging for GlobalTrafficPolicy events in GlobalTr…
Browse files Browse the repository at this point in the history
…… (#826)

* MESH-XXXX: Enhance logging for GlobalTrafficPolicy events in GlobalTrafficHandler
  • Loading branch information
Punakshi Chaand committed Dec 12, 2024
1 parent 4c606db commit 0ac9af3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions admiral/pkg/clusters/globaltraffic_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func (g *globalTrafficCache) Delete(identity string, environment string) error {

func (gtp *GlobalTrafficHandler) Added(ctx context.Context, obj *v1.GlobalTrafficPolicy) error {
log.Infof(LogFormat, "Added", "globaltrafficpolicy", obj.Name, gtp.ClusterID, "received")
log.Infof(LogFormat, "Added", "globaltrafficpolicy", obj.Name, gtp.ClusterID, fmt.Sprintf("received gtp: %v", obj))
err := HandleEventForGlobalTrafficPolicy(ctx, admiral.Add, obj, gtp.RemoteRegistry, gtp.ClusterID, modifyServiceEntryForNewServiceOrPod)
if err != nil {
return fmt.Errorf(LogErrFormat, "Added", "globaltrafficpolicy", obj.Name, gtp.ClusterID, err.Error())
Expand All @@ -75,6 +76,7 @@ func (gtp *GlobalTrafficHandler) Added(ctx context.Context, obj *v1.GlobalTraffi

func (gtp *GlobalTrafficHandler) Updated(ctx context.Context, obj *v1.GlobalTrafficPolicy) error {
log.Infof(LogFormat, "Updated", "globaltrafficpolicy", obj.Name, gtp.ClusterID, "received")
log.Infof(LogFormat, "Updated", "globaltrafficpolicy", obj.Name, gtp.ClusterID, fmt.Sprintf("received gtp: %v", obj))
err := HandleEventForGlobalTrafficPolicy(ctx, admiral.Update, obj, gtp.RemoteRegistry, gtp.ClusterID, modifyServiceEntryForNewServiceOrPod)
if err != nil {
return fmt.Errorf(LogErrFormat, "Updated", "globaltrafficpolicy", obj.Name, gtp.ClusterID, err.Error())
Expand Down

0 comments on commit 0ac9af3

Please sign in to comment.