MCPcopy Index your code
hub / github.com/cortexlabs/cortex / ExtractVirtualServiceEndpoints

Function ExtractVirtualServiceEndpoints

pkg/lib/k8s/virtual_service.go:276–290  ·  view source on GitHub ↗
(virtualService *istioclientnetworking.VirtualService)

Source from the content-addressed store, hash-verified

274}
275
276func ExtractVirtualServiceEndpoints(virtualService *istioclientnetworking.VirtualService) strset.Set {
277 endpoints := strset.New()
278 for _, http := range virtualService.Spec.Http {
279 for _, match := range http.Match {
280 if match.Uri.GetExact() != "" {
281 endpoints.Add(urls.CanonicalizeEndpoint(match.Uri.GetExact()))
282 }
283
284 if match.Uri.GetPrefix() != "" {
285 endpoints.Add(urls.CanonicalizeEndpoint(match.Uri.GetPrefix()))
286 }
287 }
288 }
289 return endpoints
290}

Callers 1

Calls 3

NewFunction · 0.92
CanonicalizeEndpointFunction · 0.92
AddMethod · 0.45

Tested by

no test coverage detected