(ref reference.Named, insecure bool)
| 28 | } |
| 29 | |
| 30 | func newDefaultRepositoryEndpoint(ref reference.Named, insecure bool) (repositoryEndpoint, error) { |
| 31 | indexInfo := registry.NewIndexInfo(ref) |
| 32 | endpoint, err := getDefaultEndpoint(ref, !indexInfo.Secure) |
| 33 | if err != nil { |
| 34 | return repositoryEndpoint{}, err |
| 35 | } |
| 36 | if insecure { |
| 37 | endpoint.TLSConfig.InsecureSkipVerify = true |
| 38 | } |
| 39 | return repositoryEndpoint{ |
| 40 | repoName: reference.Path(reference.TrimNamed(ref)), |
| 41 | indexInfo: indexInfo, |
| 42 | endpoint: endpoint, |
| 43 | }, nil |
| 44 | } |
| 45 | |
| 46 | func getDefaultEndpoint(repoName reference.Named, insecure bool) (registry.APIEndpoint, error) { |
| 47 | registryService, err := registry.NewService(registry.ServiceOptions{}) |
no test coverage detected
searching dependent graphs…