Skip to content

Commit

Permalink
Use merge of enterprise meta's rather than new custom method
Browse files Browse the repository at this point in the history
  • Loading branch information
jm96441n committed Mar 27, 2023
1 parent 9217ac1 commit 7f5e9ba
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions agent/structs/config_entry_routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ func (e *HTTPRouteConfigEntry) Normalize() error {
if parent.Kind == "" {
parent.Kind = APIGateway
}
parent.EnterpriseMeta.Normalize()
parent.Merge(e.GetEnterpriseMeta())
parent.Normalize()
e.Parents[i] = parent
}

Expand All @@ -91,16 +92,17 @@ func (e *HTTPRouteConfigEntry) Normalize() error {
}

for j, service := range rule.Services {
rule.Services[j] = normalizeHTTPService(service)
rule.Services[j] = e.normalizeHTTPService(service)
}
e.Rules[i] = rule
}

return nil
}

func normalizeHTTPService(service HTTPService) HTTPService {
service.EnterpriseMeta.Normalize()
func (e *HTTPRouteConfigEntry) normalizeHTTPService(service HTTPService) HTTPService {
service.Merge(e.GetEnterpriseMeta())
service.Normalize()
if service.Weight <= 0 {
service.Weight = 1
}
Expand Down

0 comments on commit 7f5e9ba

Please sign in to comment.