Skip to content

Extract daemon configuration and discovery to their own package#29673

Merged
LK4D4 merged 1 commit intomoby:masterfrom
vdemeester:extract-daemon-config
Feb 13, 2017
Merged

Extract daemon configuration and discovery to their own package#29673
LK4D4 merged 1 commit intomoby:masterfrom
vdemeester:extract-daemon-config

Conversation

@vdemeester
Copy link
Member

@vdemeester vdemeester commented Dec 23, 2016

The daemon package is really big and not well unit tested. This small step extract 2 relatively less coupled functionnality of daemon into their own package.

This also moves some cli specific in cmd/dockerd as it does not really belong to the daemon/config package. There is still a pflags dependency on the valueSet field, I added a comment on that to fix.

This is the coverage almost as is — just complete the Validate test, but the diff is getting pretty big already so I'll do a follow-up for the tests.

ok      github.com/docker/docker/daemon/config  0.010s  coverage: 60.2% of statements
ok      github.com/docker/docker/daemon/discovery       0.006s  coverage: 31.9% of statements

/cc @dnephin @thaJeztah @icecrime @cpuguy83 @crosbymichael @AkihiroSuda @tonistiigi

🐸

Signed-off-by: Vincent Demeester [email protected]

Copy link
Member

@dnephin dnephin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a good incremental step. Still a lot of work to do to make daemon a sane package.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CommonUnix seems like a strange name here. Maybe installUnixConfigFlags() ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same goes for the other CommonUnix variables

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This constant appears to be only used in one place. It would be better to keep it unexported and move it to where it is used.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still called? It seems like it was removed from the other platforms, so I think this might be broken on solaris.

@vdemeester vdemeester force-pushed the extract-daemon-config branch from 58713b2 to 02302fb Compare December 28, 2016 08:58
@vdemeester
Copy link
Member Author

@dnephin updated 👼

Still a lot of work to do to make daemon a sane package.

You don't say 😅

@thaJeztah
Copy link
Member

needs a rebase now @vdemeester 😢

@vdemeester vdemeester force-pushed the extract-daemon-config branch from 02302fb to 719ead9 Compare December 28, 2016 15:59
@vdemeester
Copy link
Member Author

Hum windows failure is legit.. messed up build tags 😅

@thaJeztah thaJeztah added the status/failing-ci Indicates that the PR in its current state fails the test suite label Dec 28, 2016
@vdemeester vdemeester force-pushed the extract-daemon-config branch from 719ead9 to 6debd1c Compare December 28, 2016 17:52
@vdemeester vdemeester removed the status/failing-ci Indicates that the PR in its current state fails the test suite label Dec 28, 2016
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if green

@vdemeester
Copy link
Member Author

Rebased 👼

@cpuguy83
Copy link
Member

cpuguy83 commented Jan 9, 2017

Build errors

@vdemeester
Copy link
Member Author

arf… damn rebase 😂

@vdemeester vdemeester force-pushed the extract-daemon-config branch 3 times, most recently from 58d9bd8 to a9ebdb6 Compare January 12, 2017 15:54
@vdemeester vdemeester force-pushed the extract-daemon-config branch from a9ebdb6 to 09d5edd Compare January 23, 2017 11:23
@vdemeester vdemeester force-pushed the extract-daemon-config branch from 09d5edd to ad492fa Compare January 30, 2017 13:25
@dnephin
Copy link
Member

dnephin commented Feb 1, 2017

needs a rebase

@vdemeester vdemeester force-pushed the extract-daemon-config branch 6 times, most recently from 27fbc52 to f01a03c Compare February 1, 2017 17:47
@thaJeztah
Copy link
Member

@vdemeester test is failing on windows;

7:56:09 # github.com/docker/docker/cmd/dockerd
17:56:09 cmd\dockerd\config_unix_test.go:22: conf.ShmSize undefined (type *"github.com/docker/docker/daemon/config".Config has no field or method ShmSize)
17:56:09 cmd\dockerd\config_unix_test.go:23: conf.ShmSize undefined (type *"github.com/docker/docker/daemon/config".Config has no field or method ShmSize)
17:56:09 cmd\dockerd\config_unix_test.go:27: conf.ShmSize undefined (type *"github.com/docker/docker/daemon/config".Config has no field or method ShmSize)
17:56:09 cmd\dockerd\config_unix_test.go:28: conf.ShmSize undefined (type *"github.com/docker/docker/daemon/config".Config has no field or method ShmSize)
17:56:09 FAIL	github.com/docker/docker/cmd/dockerd [build failed]

@vdemeester
Copy link
Member Author

/ping @justincormack @runcom @AkihiroSuda 😝

@allencloud
Copy link
Contributor

need rebase again ^^ @vdemeester

This also moves some cli specific in `cmd/dockerd` as it does not
really belong to the `daemon/config` package.

Signed-off-by: Vincent Demeester <[email protected]>
Copy link
Contributor

@LK4D4 LK4D4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@LK4D4 LK4D4 merged commit f3a8886 into moby:master Feb 13, 2017
@GordonTheTurtle GordonTheTurtle added this to the 1.14.0 milestone Feb 13, 2017
@vdemeester vdemeester deleted the extract-daemon-config branch February 13, 2017 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants