SignatureStorageBaseURL reads configuration to find an appropriate lookaside storage URL for ref, for write access if “write”. the usage of the BaseURL is defined under docker/distribution registries—separate storage of docs/signature-protocols.md Warning: This function only exposes configuration in
(sys *types.SystemContext, ref types.ImageReference, write bool)
| 64 | // Warning: This function only exposes configuration in registries.d; |
| 65 | // just because this function returns an URL does not mean that the URL will be used by c/image/docker (e.g. if the registry natively supports X-R-S-S). |
| 66 | func SignatureStorageBaseURL(sys *types.SystemContext, ref types.ImageReference, write bool) (*url.URL, error) { |
| 67 | dr, ok := ref.(dockerReference) |
| 68 | if !ok { |
| 69 | return nil, errors.New("ref must be a dockerReference") |
| 70 | } |
| 71 | config, err := loadRegistryConfiguration(sys) |
| 72 | if err != nil { |
| 73 | return nil, err |
| 74 | } |
| 75 | |
| 76 | return config.lookasideStorageBaseURL(dr, write) |
| 77 | } |
| 78 | |
| 79 | // loadRegistryConfiguration returns a registryConfiguration appropriate for sys. |
| 80 | func loadRegistryConfiguration(sys *types.SystemContext) (*registryConfiguration, error) { |
searching dependent graphs…