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
#365)

…… (#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 <[email protected]>
  • Loading branch information
Punakshi and Punakshi Chaand authored Dec 12, 2024
1 parent 4c606db commit 39eaa5c
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 39eaa5c

Please sign in to comment.