fix delete manifest route issue

The repository name contains blackslash, the mux router has to use the * to match the blackslash. Otherwise the caller(gc job) will get a 404.

Signed-off-by: wang yan <wangyan@vmware.com>
This commit is contained in:
wang yan 2020-07-02 13:42:38 +08:00
parent 1d03b8727a
commit 12c92dbfce

View File

@ -33,6 +33,6 @@ func newRouter(conf config.Configuration) http.Handler {
rootRouter.Path("/api/registry/gc").Methods(http.MethodPost).Handler(gc.NewHandler(conf.RegistryConfig))
rootRouter.Path("/api/registry/blob/{reference}").Methods(http.MethodDelete).Handler(blob.NewHandler(conf.StorageDriver))
rootRouter.Path("/api/registry/{name}/manifests/{reference}").Methods(http.MethodDelete).Handler(manifest.NewHandler(conf.StorageDriver))
rootRouter.Path("/api/registry/{name:.*}/manifests/{reference}").Methods(http.MethodDelete).Handler(manifest.NewHandler(conf.StorageDriver))
return rootRouter
}