Skip to content

Commit

Permalink
Addressing review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
srahul3 committed Jun 7, 2023
1 parent 14fa790 commit 9f396c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions control-plane/catalog/to-consul/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ func (t *ServiceResource) generateRegistrations(key string) {
r.Service.Address = ip
// Adding information about service weight.
// Overrides the existing weight if present
if weight, ok := svc.Annotations[annotationServiceWeight]; ok || weight != "" {
if weight, ok := svc.Annotations[annotationServiceWeight]; ok && weight != "" {
err := setServiceWeight(weight, len(ips), &r)
if err != nil {
t.Log.Debug("assertion: The service with ",
Expand Down Expand Up @@ -561,7 +561,7 @@ func (t *ServiceResource) generateRegistrations(key string) {

// Adding information about service weight.
// Overrides the existing weight if present
if weight, ok := svc.Annotations[annotationServiceWeight]; ok || weight != "" {
if weight, ok := svc.Annotations[annotationServiceWeight]; ok && weight != "" {
ingress_count := len(svc.Status.LoadBalancer.Ingress)
err := setServiceWeight(weight, ingress_count, &r)
if err != nil {
Expand Down

0 comments on commit 9f396c3

Please sign in to comment.