From 39eaa5c3c1598fb4b6410c91e9ee3b24a3903d23 Mon Sep 17 00:00:00 2001 From: Punakshi Chaand Date: Thu, 12 Dec 2024 15:32:04 -0800 Subject: [PATCH] =?UTF-8?q?MESH-0000:=20Enhance=20logging=20for=20GlobalTr?= =?UTF-8?q?afficPolicy=20events=20in=20GlobalTr=E2=80=A6=20(#365)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …… (#826) * MESH-XXXX: Enhance logging for GlobalTrafficPolicy events in GlobalTrafficHandler ### Checklist 🚨 Please review this repository's [contribution guidelines](./CONTRIBUTING.md). - [ ] I've read and agree to the project's contribution guidelines. - [ ] I'm requesting to **pull a topic/feature/bugfix branch**. - [ ] I checked that my code additions will pass code linting checks and unit tests. - [ ] I updated unit and integration tests (if applicable). - [ ] I'm ready to notify the team of this contribution. ### Description What does this change do and why? [Link to related ISSUE] Thank you! Co-authored-by: Punakshi Chaand --- admiral/pkg/clusters/globaltraffic_handler.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/admiral/pkg/clusters/globaltraffic_handler.go b/admiral/pkg/clusters/globaltraffic_handler.go index 6dd367c1a..7fac9a131 100644 --- a/admiral/pkg/clusters/globaltraffic_handler.go +++ b/admiral/pkg/clusters/globaltraffic_handler.go @@ -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()) @@ -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())