Add support for registry host path override

Adds support for mirrors which are non-compliant with the
OCI distribution specification but have previously mirrored
content with a namespace prefix after the API root `/v2`.

Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
Derek McGowan
2021-07-01 17:49:32 -07:00
parent 95c708572f
commit a7ad6b3be5
3 changed files with 42 additions and 7 deletions

View File

@@ -274,6 +274,17 @@ or
x-custom-1-2 = "another custom header"
```
## override_path field
`override_path` is used to indicate the host's API root endpoint is defined
in the URL path rather than by the API specification. This may be used with
non-compliant OCI registries which are missing the `/v2` prefix.
(Defaults to `false`)
```
override_path = true
```
## host field(s) (in the toml table format)
`[host]."https://namespace"` and `[host].http://namespace` entries in the
@@ -310,6 +321,10 @@ for this registry host namespace:
[host."https://test-3.registry"]
client = ["/etc/certs/client-1.pem", "/etc/certs/client-2.pem"]
[host."https://non-compliant-mirror.registry/v2/upstream"]
capabilities = ["pull"]
override_path = true
```
**Note**: Recursion is not supported in the specification of host mirror