Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MESH-000: Add detailed logging for client-initiated processing and gl… #364

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions admiral/pkg/clusters/deployment_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func HandleEventForDeployment(ctx context.Context, event admiral.EventType, obj
// Use the same function as added deployment function to update and put new service entry in place to replace old one
_, err := modifyServiceEntryForNewServiceOrPod(ctx, event, env, globalIdentifier, remoteRegistry)
if common.ClientInitiatedProcessingEnabled() {
log.Infof(LogFormat, event, common.DeploymentResourceType, obj.Name, clusterName, "Client initiated processing started for "+globalIdentifier)
depProcessErr := processClientDependencyRecord(ctx, remoteRegistry, globalIdentifier, clusterName, obj.Namespace)
if depProcessErr != nil {
return common.AppendError(err, depProcessErr)
Expand Down
1 change: 1 addition & 0 deletions admiral/pkg/clusters/rollout_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func HandleEventForRollout(ctx context.Context, event admiral.EventType, obj *ar
_, err := modifyServiceEntryForNewServiceOrPod(ctx, event, env, globalIdentifier, remoteRegistry)

if common.ClientInitiatedProcessingEnabled() {
log.Infof(LogFormat, event, common.DeploymentResourceType, obj.Name, clusterName, "Client initiated processing started for "+globalIdentifier)
rolloutProcessErr := processClientDependencyRecord(ctx, remoteRegistry, globalIdentifier, clusterName, obj.Namespace)
if rolloutProcessErr != nil {
return common.AppendError(err, rolloutProcessErr)
Expand Down
7 changes: 5 additions & 2 deletions admiral/pkg/clusters/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,12 +351,15 @@ func processClientDependencyRecord(ctx context.Context, remoteRegistry *RemoteRe
var destinationsToBeProcessed []string

destinationsToBeProcessed = getDestinationsToBeProcessedForClientInitiatedProcessing(remoteRegistry, globalIdentifier, clusterName, clientNs, destinationsToBeProcessed)

log.Infof(LogFormat, "Update", common.DependencyResourceType, globalIdentifier, clusterName, fmt.Sprintf("destinationsToBeProcessed=%v", destinationsToBeProcessed))
var sourceClusterMap = common.NewMap()
sourceClusterMap.Put(clusterName, clusterName)

err := processDestinationsForSourceIdentity(ctx, remoteRegistry, "Update", true, sourceClusterMap, destinationsToBeProcessed, globalIdentifier, modifyServiceEntryForNewServiceOrPod)
return err
if err != nil {
return errors.New("failed to perform client initiated processing for " + globalIdentifier + ", got error: " + err.Error())
}
return nil
}

func getDestinationsToBeProcessedForClientInitiatedProcessing(remoteRegistry *RemoteRegistry, globalIdentifier string, clusterName string, clientNs string, destinationsToBeProcessed []string) []string {
Expand Down