allEndpoints returns a list of endpoints ordered by priority (v2, http).
(ctx context.Context, namedRef reference.Named, insecure bool)
| 276 | |
| 277 | // allEndpoints returns a list of endpoints ordered by priority (v2, http). |
| 278 | func allEndpoints(ctx context.Context, namedRef reference.Named, insecure bool) ([]registry.APIEndpoint, error) { |
| 279 | var serviceOpts registry.ServiceOptions |
| 280 | if insecure { |
| 281 | logrus.Debugf("allowing insecure registry for: %s", reference.Domain(namedRef)) |
| 282 | serviceOpts.InsecureRegistries = []string{reference.Domain(namedRef)} |
| 283 | } |
| 284 | registryService, err := registry.NewService(serviceOpts) |
| 285 | if err != nil { |
| 286 | return nil, err |
| 287 | } |
| 288 | endpoints, err := registryService.Endpoints(ctx, reference.Domain(namedRef)) |
| 289 | logrus.Debugf("endpoints for %s: %v", namedRef, endpoints) |
| 290 | return endpoints, err |
| 291 | } |
| 292 | |
| 293 | type notFoundError struct{ error } |
| 294 |
no test coverage detected
searching dependent graphs…