Skip to content

Commit

Permalink
Fix PublishL4NetLBDualStackSyncLatency
Browse files Browse the repository at this point in the history
  • Loading branch information
panslava committed Mar 13, 2023
1 parent 12624df commit 39e3099
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pkg/l4lb/l4controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,8 @@ func (l4c *L4Controller) processServiceDeletion(key string, svc *v1.Service) *lo
if l4c.enableDualStack {
if err := updateL4DualStackResourcesAnnotations(l4c.ctx, svc, nil); err != nil {
l4c.ctx.Recorder(svc.Namespace).Eventf(svc, v1.EventTypeWarning, "DeleteLoadBalancer",
"Error resetting resource annotations for load balancer: %v", err)
result.Error = fmt.Errorf("failed to reset resource annotations, err: %w", err)
"Error resetting DualStack resource annotations for load balancer: %v", err)
result.Error = fmt.Errorf("failed to reset DualStack resource annotations, err: %w", err)
return result
}
} else {
Expand Down
10 changes: 5 additions & 5 deletions pkg/l4lb/l4netlbcontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -623,14 +623,14 @@ func (lc *L4NetLBController) garbageCollectRBSNetLB(key string, svc *v1.Service)
if lc.enableDualStack {
if err := deleteL4RBSDualStackAnnotations(lc.ctx, svc); err != nil {
lc.ctx.Recorder(svc.Namespace).Eventf(svc, v1.EventTypeWarning, "DeleteLoadBalancer",
"Error removing Dual Stack resource annotations: %v: %v", err)
"Error removing Dual Stack resource annotations: %v", err)
result.Error = fmt.Errorf("failed to reset Dual Stack resource annotations, err: %w", err)
return result
}
} else {
if err := deleteL4RBSAnnotations(lc.ctx, svc); err != nil {
lc.ctx.Recorder(svc.Namespace).Eventf(svc, v1.EventTypeWarning, "DeleteLoadBalancer",
"Error removing resource annotations: %v: %v", err)
"Error removing resource annotations: %v", err)
result.Error = fmt.Errorf("failed to reset resource annotations, err: %w", err)
return result
}
Expand Down Expand Up @@ -669,12 +669,12 @@ func (lc *L4NetLBController) publishMetrics(result *loadbalancers.L4NetLBSyncRes
}

func (lc *L4NetLBController) publishSyncMetrics(result *loadbalancers.L4NetLBSyncResult) {
if lc.enableDualStack {
metrics.PublishL4NetLBDualStackSyncLatency(result.Error == nil, result.SyncType, result.DualStackMetricsState.IPFamilies, result.StartTime)
}
if result.Error == nil {
metrics.PublishL4NetLBSyncSuccess(result.SyncType, result.StartTime)
return
}
metrics.PublishL4NetLBSyncError(result.SyncType, result.GCEResourceInError, utils.GetErrorType(result.Error), result.StartTime)
if lc.enableDualStack {
metrics.PublishL4NetLBDualStackSyncLatency(result.Error == nil, result.SyncType, result.DualStackMetricsState.IPFamilies, result.StartTime)
}
}

0 comments on commit 39e3099

Please sign in to comment.