Skip to content

Commit

Permalink
fix: missing lb event (#2021)
Browse files Browse the repository at this point in the history
* fix: turn missing load balancer log into an event

Signed-off-by: zachaller <zachaller@hotmail.com>

* consistent naming

Signed-off-by: zachaller <zachaller@hotmail.com>
  • Loading branch information
zachaller authored May 5, 2022
1 parent b364782 commit 03636ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rollout/trafficrouting/alb/alb.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func (r *Reconciler) VerifyWeight(desiredWeight int32, additionalDestinations ..
return pointer.BoolPtr(false), err
}
if lb == nil || lb.LoadBalancerArn == nil {
r.log.Infof("LoadBalancer %s not found", lbIngress.Hostname)
r.cfg.Recorder.Warnf(rollout, record.EventOptions{EventReason: conditions.LoadBalancerNotFoundReason}, conditions.LoadBalancerNotFoundMessage, lbIngress.Hostname)
return pointer.BoolPtr(false), nil
}

Expand Down
3 changes: 3 additions & 0 deletions utils/conditions/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ const (
// WeightVerifyErrorReason is emitted when there is an error verifying the set weight
WeightVerifyErrorReason = "WeightVerifyError"
WeightVerifyErrorMessage = "Failed to verify weight: %s"
// LoadBalancerNotFoundReason is emitted when load balancer can not be found
LoadBalancerNotFoundReason = "LoadBalancerNotFound"
LoadBalancerNotFoundMessage = "Failed to find load balancer: %s"
)

// NewRolloutCondition creates a new rollout condition.
Expand Down

0 comments on commit 03636ab

Please sign in to comment.