Skip to content

Commit

Permalink
Consider all HTTPProxy routes when listing services
Browse files Browse the repository at this point in the history
  • Loading branch information
mvgmb committed May 16, 2023
1 parent 169bbaf commit 4b19465
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,19 @@ func getService(name string, services []contourv1.Service) (*contourv1.Service,
}

func getServiceList(routes []contourv1.Route) ([]contourv1.Service, error) {
var services []contourv1.Service
for _, r := range routes {
if r.Services == nil {
continue
}
return r.Services, nil
services = append(services, r.Services...)
}
return nil, errors.New("the services are not found in HTTPProxy")

if len(services) == 0 {
return nil, errors.New("the services are not found in HTTPProxy")
}

return services, nil
}

func (r *RpcPlugin) SetHeaderRoute(rollout *v1alpha1.Rollout, headerRouting *v1alpha1.SetHeaderRoute) pluginTypes.RpcError {
Expand Down

0 comments on commit 4b19465

Please sign in to comment.