-
Notifications
You must be signed in to change notification settings - Fork 77
/
Copy pathpendingerrors.go
34 lines (27 loc) · 1.25 KB
/
pendingerrors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package server
import (
"github.com/docker/distribution"
"github.com/docker/distribution/context"
"github.com/openshift/image-registry/pkg/dockerregistry/server/wrapped"
)
// newPendingErrorsWrapper ensures auth completed and there were no errors relevant to the repo.
func newPendingErrorsWrapper(repo *repository) wrapped.Wrapper {
return func(ctx context.Context, funcname string, f func(ctx context.Context) error) error {
if err := repo.checkPendingErrors(ctx); err != nil {
return err
}
return f(ctx)
}
}
func newPendingErrorsBlobStore(bs distribution.BlobStore, repo *repository) distribution.BlobStore {
return wrapped.NewBlobStore(bs, newPendingErrorsWrapper(repo))
}
func newPendingErrorsManifestService(ms distribution.ManifestService, repo *repository) distribution.ManifestService {
return wrapped.NewManifestService(ms, newPendingErrorsWrapper(repo))
}
func newPendingErrorsTagService(ts distribution.TagService, repo *repository) distribution.TagService {
return wrapped.NewTagService(ts, newPendingErrorsWrapper(repo))
}
func newPendingErrorsBlobDescriptorService(bds distribution.BlobDescriptorService, repo *repository) distribution.BlobDescriptorService {
return wrapped.NewBlobDescriptorService(bds, newPendingErrorsWrapper(repo))
}