forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
registry.go
23 lines (19 loc) · 809 Bytes
/
registry.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package server
import (
log "github.com/Sirupsen/logrus"
"github.com/docker/distribution"
"github.com/docker/distribution/context"
"github.com/docker/distribution/registry/middleware/registry"
)
// dockerRegistry represents a collection of repositories, addressable by name.
// This variable holds the object created by the docker/distribution. We import
// it into our namespace because there are no other ways to access it. In other
// cases it is hidden from us.
var dockerRegistry distribution.Namespace
func init() {
middleware.Register("openshift", func(ctx context.Context, registry distribution.Namespace, options map[string]interface{}) (distribution.Namespace, error) {
log.Info("OpenShift registry middleware initializing")
dockerRegistry = registry
return dockerRegistry, nil
})
}