mirror of
https://github.com/clearlinux/docker.git
synced 2026-10-03 15:28:35 +00:00
make http usage for registry explicit
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack) Conflicts: daemon/config.go daemon/daemon.go graph/pull.go graph/push.go graph/tags.go registry/registry.go registry/service.go
This commit is contained in:
+3
-1
@@ -113,7 +113,9 @@ func (s *TagStore) CmdPull(job *engine.Job) engine.Status {
|
||||
return job.Error(err)
|
||||
}
|
||||
|
||||
endpoint, err := registry.NewEndpoint(hostname)
|
||||
secure := registry.IsSecure(hostname, s.InsecureRegistries)
|
||||
|
||||
endpoint, err := registry.NewEndpoint(hostname, secure)
|
||||
if err != nil {
|
||||
return job.Error(err)
|
||||
}
|
||||
|
||||
+3
-1
@@ -214,7 +214,9 @@ func (s *TagStore) CmdPush(job *engine.Job) engine.Status {
|
||||
return job.Error(err)
|
||||
}
|
||||
|
||||
endpoint, err := registry.NewEndpoint(hostname)
|
||||
secure := registry.IsSecure(hostname, s.InsecureRegistries)
|
||||
|
||||
endpoint, err := registry.NewEndpoint(hostname, secure)
|
||||
if err != nil {
|
||||
return job.Error(err)
|
||||
}
|
||||
|
||||
+13
-11
@@ -23,10 +23,11 @@ var (
|
||||
)
|
||||
|
||||
type TagStore struct {
|
||||
path string
|
||||
graph *Graph
|
||||
mirrors []string
|
||||
Repositories map[string]Repository
|
||||
path string
|
||||
graph *Graph
|
||||
mirrors []string
|
||||
InsecureRegistries []string
|
||||
Repositories map[string]Repository
|
||||
sync.Mutex
|
||||
// FIXME: move push/pull-related fields
|
||||
// to a helper type
|
||||
@@ -54,18 +55,19 @@ func (r Repository) Contains(u Repository) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func NewTagStore(path string, graph *Graph, mirrors []string) (*TagStore, error) {
|
||||
func NewTagStore(path string, graph *Graph, mirrors []string, insecureRegistries []string) (*TagStore, error) {
|
||||
abspath, err := filepath.Abs(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
store := &TagStore{
|
||||
path: abspath,
|
||||
graph: graph,
|
||||
mirrors: mirrors,
|
||||
Repositories: make(map[string]Repository),
|
||||
pullingPool: make(map[string]chan struct{}),
|
||||
pushingPool: make(map[string]chan struct{}),
|
||||
path: abspath,
|
||||
graph: graph,
|
||||
mirrors: mirrors,
|
||||
InsecureRegistries: insecureRegistries,
|
||||
Repositories: make(map[string]Repository),
|
||||
pullingPool: make(map[string]chan struct{}),
|
||||
pushingPool: make(map[string]chan struct{}),
|
||||
}
|
||||
// Load the json file if it exists, otherwise create it.
|
||||
if err := store.reload(); os.IsNotExist(err) {
|
||||
|
||||
Reference in New Issue
Block a user