1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
Commit graph

28 commits

Author SHA1 Message Date
Phil Estes
459e58ffc9 Fix daemon shutdown on error after rework of daemon startup
Currently the daemon will not stop on error because the serve API job is
blocking the channel wait for daemon init.  A better way is to run the
blocking serve API job as a goroutine and make sure that error
notification gets back to the main daemon thread (using the already
existing channel) so that clean shutdown can occur on error.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-03-17 14:15:00 -04:00
Jessica Frazelle
17a784aa09 cleanup defer func
Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <hugs@docker.com> (github: jfrazelle)
2015-03-10 12:18:43 -07:00
Brian Goff
0e3f2f2ac0 Ensure clean engine shutdown on startup errors
Previously on error either from the daemon or from the api it is just
exiting with exit status 1 but not performing a shutdown.
This can produce insconsistent state depending on where the error came
from.

This makes sure that before we exit on error that the engine gets fully
shutdown.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-03-09 08:40:38 -04:00
resouer
f3dd2db4ff Add cors header flag and leave boolean flag not changed
Deprecate api-enable-cors

Update docs & man files

Signed-off-by: harry zhang <resouer@163.com>
2015-03-03 11:21:19 +08:00
Srini Brahmaroutu
6871b9b16a Removing -X flag option and autogenerated code to create Dockerversion.go functionality
Addresses #9207

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-02-20 05:40:12 +00:00
Aidan Hobson Sayers
06ea5fe979 Move daemon-only flags into the daemon config struct
Signed-off-by: Aidan Hobson Sayers <aidanhs@cantab.net>
2015-02-08 12:56:18 +00:00
Ahmet Alp Balkan
f9ae2d4fd4 Export $HOME lookup to pkg/homedir
Signed-off-by: Ahmet Alp Balkan <ahmetb@microsoft.com>
2015-02-06 11:42:45 -08:00
Ahmet Alp Balkan
6ffb77afd4 Extract $HOME usages into utils.GetHomeDir()
Refactored getHomeDir in docker/docker to GetHomeDir in utils
pkg. Currently covers all use cases on the client-side.

Signed-off-by: Ahmet Alp Balkan <ahmetb@microsoft.com>
2015-02-05 16:13:51 -08:00
Derek McGowan
d55e977cf5 Fix nits and defers
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-01-22 11:22:31 -08:00
Derek McGowan
007ef161b4 Add key migration to daemon
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-01-21 16:55:05 -08:00
Don Kjer
568f86eb18 Deprecating ResolveRepositoryName
Passing RepositoryInfo to ResolveAuthConfig, pullRepository, and pushRepository

Moving --registry-mirror configuration to registry config

Created resolve_repository job

Repo names with 'index.docker.io' or 'docker.io' are now synonymous with omitting an index name.

Adding test for RepositoryInfo

Adding tests for opts.StringSetOpts and registry.ValidateMirror

Fixing search term use of repoInfo

Adding integration tests for registry mirror configuration

Normalizing LookupImage image name to match LocalName parsing rules

Normalizing repository LocalName to avoid multiple references to an official image

Removing errorOut use in tests

Removing TODO comment

gofmt changes

golint comments cleanup.  renaming RegistryOptions => registry.Options, and RegistryServiceConfig => registry.ServiceConfig

Splitting out builtins.Registry and registry.NewService calls

Stray whitespace cleanup

Moving integration tests for Mirrors and InsecureRegistries into TestNewIndexInfo unit test

Factoring out ValidateRepositoryName from NewRepositoryInfo

Removing unused IndexServerURL

Allowing json marshaling of ServiceConfig.  Exposing ServiceConfig in /info

Switching to CamelCase for json marshaling

PR cleanup; removing 'Is' prefix from boolean members.  Removing unneeded json tags.

Removing non-cleanup related fix for 'localhost:[port]' in splitReposName

Merge fixes for gh9735

Fixing integration test

Reapplying #9754

Adding comment on config.IndexConfigs use from isSecureIndex

Remove unused error return value from isSecureIndex

Signed-off-by: Don Kjer <don.kjer@gmail.com>

Adding back comment in isSecureIndex

Signed-off-by: Don Kjer <don.kjer@gmail.com>
2015-01-08 20:14:58 +00:00
Victor Vieux
9a85f60c75 add ID and Hostname in docker info
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-11-17 19:23:41 +00:00
Jessie Frazelle
793fb26bff Merge pull request #8510 from hqhq/graphdriver_bug
daemon: resolve the graphdriver to show
2014-10-30 17:40:30 -07:00
Michael Crosby
afade4236d Don't hard code true for auth job
Signed-off-by: Michael Crosby <michael@docker.com>

Conflicts:
	registry/service.go
2014-10-30 19:41:55 -04:00
Alexandr Morozov
7c62cee51e Use logrus everywhere for logging
Fixed #8761

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2014-10-24 15:03:06 -07:00
Qiang Huang
7cf322dffc daemon: resolve the graphdriver to show
graphdriver is not always specified when the log printed, because
it's provided in another thread. This patch will fix this.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2014-10-21 15:00:25 +08:00
Vincent Batts
92df943fbf daemon logging: unifying output and timestamps
A little refactor of the ./pkg/log so engine can have a logger instance

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2014-09-26 14:44:46 -04:00
Erik Hollensbe
1ae4c00a19 builder: fix references to jobs in daemon, make builder a first class
package referring to evaluator

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-08-27 18:52:30 -07:00
Solomon Hykes
1d10c55aec Move remote API config out of daemon/
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-13 19:25:51 +00:00
Solomon Hykes
1eba59eb24 Check for conflicting daemon config options in NewDaemon
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-13 19:25:51 +00:00
Solomon Hykes
ca11b77471 opts.IPVal returns an error on incorrect input
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-13 19:25:51 +00:00
Solomon Hykes
353b7c8ec7 Parse daemon configuration in daemon.Config.InstallFlags instead of main
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-13 19:25:51 +00:00
Solomon Hykes
a4befff533 Move daemonconfig into daemon
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-13 19:09:51 +00:00
Solomon Hykes
63503cafe4 Remove deprecated server/ package
Victory!

Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-13 06:56:45 +00:00
Michael Crosby
7321067176 Use argv0 as reexec implementation for dockerinit
This changes the way the exec drivers work by not specifing a -driver
flag on reexec.  For each of the exec  drivers they register their own
functions that will be matched aginst the argv 0 on exec and called if
they match.

This also allows any functionality to be added to docker so that the
binary can be reexec'd and any type of function can be called.  I moved
the flag parsing on docker exec to the specific initializers so that the
implementations do not bleed into one another.  This also allows for
more flexability within reexec initializers to specify their own flags
and options.

Signed-off-by: Michael Crosby <michael@docker.com>
2014-08-11 11:47:21 -07:00
Solomon Hykes
b4efcd53e0 Remove unnecessary job "initserverpidfile"
That job was a hacky solution to a real race condition. This removes the
hack without re-introducing the race.

Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:56:11 +00:00
Solomon Hykes
c9f3fd3fc7 Cleanup: refactor shutdown and signal handling facility
This disentangles the following functions, which were previously all mixed together:

* 1) Waiting for jobs to terminate when shutting down
* 2) Handling signals in the Docker daemon
* 3) Per-subsystem cleanup handlers
* 4) pidfile management

Responsibilities are dispatched as follows:

* Signal traps are set in `main`, and trigger `engine.Shutdown`
* `engine.Shutdown` coordinates cleanup by waiting for jobs to complete, and calling shutdown handlers
* To perform cleanup at shutdown, each subsystem registers handlers with `engine.OnShutdown`
* `daemon` is one subsystem, so it registers cleanup via `engine.OnShutdown`.
* `daemon` owns the pidfile, which is used to lock access to `/var/lib/docker`. Part of its cleanup is to remove the pidfile.

Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:56:11 +00:00
Tianon Gravi
1b95590d06 Add a "daemon" build tag and toggle it with the already-existing "DOCKER_CLIENTONLY" build variable
This works mostly by refactoring our "main" package to be careful about what it imports based on the daemon build tag. :)

Also, I've updated Travis to test "client-only" compilation after it tests the daemon version.

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-08-04 15:05:12 -06:00