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:
unclejack
2014-10-20 16:51:05 -04:00
committed by Tibor Vass
parent c78088fe3d
commit f9b4bfa59b
8 changed files with 74 additions and 16 deletions
+3 -1
View File
@@ -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
View File
@@ -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
View File
@@ -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) {