-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Expand file tree
/
Copy pathregistry.go
More file actions
23 lines (19 loc) · 809 Bytes
/
registry.go
File metadata and controls
23 lines (19 loc) · 809 Bytes
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
})
}