Move initialization code from main.go to the registry package

This makes it easier to embed a registry instance inside another
application.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
This commit is contained in:
Aaron Lehmann
2015-08-20 13:56:36 -07:00
parent 7a305cc8cd
commit 9b69e40c93
7 changed files with 313 additions and 258 deletions

View File

@@ -31,7 +31,7 @@ func TestAppDispatcher(t *testing.T) {
t.Fatalf("error creating registry: %v", err)
}
app := &App{
Config: configuration.Configuration{},
Config: &configuration.Configuration{},
Context: ctx,
router: v2.Router(),
driver: driver,
@@ -164,7 +164,7 @@ func TestNewApp(t *testing.T) {
// Mostly, with this test, given a sane configuration, we are simply
// ensuring that NewApp doesn't panic. We might want to tweak this
// behavior.
app := NewApp(ctx, config)
app := NewApp(ctx, &config)
server := httptest.NewServer(app)
builder, err := v2.NewURLBuilderFromString(server.URL)