-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[18.09] Refine how metadata dir is handled #1388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
de356f9 to
fcb28d7
Compare
Codecov Report
@@ Coverage Diff @@
## 18.09 #1388 +/- ##
==========================================
- Coverage 54.15% 54.09% -0.06%
==========================================
Files 290 290
Lines 19298 19313 +15
==========================================
- Hits 10451 10448 -3
- Misses 8181 8201 +20
+ Partials 666 664 -2 |
fcb28d7 to
278ac38
Compare
|
Note: this depends on the packaging change PR(s) |
thaJeztah
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did a quick read over the code, left some comments
| authConfig *types.AuthConfig, healthfn func(context.Context) error) error { | ||
| authConfig *types.AuthConfig, healthfn func(context.Context) error, runtimeMetadataDir string) error { | ||
|
|
||
| // If the user didn't specify an image, detemrine the correct enterprise image to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: typo; s/detemrine/determine/
| return err | ||
| } | ||
| if strings.Contains(strings.ToLower(serverVersion.Platform.Name), "enterprise") { | ||
| return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should either treat this as an error-situation, or inform the user that no changes were made. In the "happy path", a message will be printed "Successfully activated engine". If we're already on EE, I'd expect some form of feedback as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sound good to make this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dhiltgen follow-up PR ^^^
| // ActivateEngine will switch the image from the CE to EE image | ||
| func (c *baseClient) ActivateEngine(ctx context.Context, opts clitypes.EngineInitOptions, out clitypes.OutStream, | ||
| authConfig *types.AuthConfig, healthfn func(context.Context) error) error { | ||
| authConfig *types.AuthConfig, healthfn func(context.Context) error, runtimeMetadataDir string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of adding another argument, can we add runtimeMetadataDir as a field on clitypes.EngineInitOptions ?
cli/command/engine/client_test.go
Outdated
| out clitypes.OutStream, | ||
| authConfig *types.AuthConfig, | ||
| healthfn func(context.Context) error) error { | ||
| healthfn func(context.Context) error, runtimeMetadataDir string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here; Instead of adding another argument, can we add runtimeMetadataDir as a field on clitypes.EngineInitOptions ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait: what's that healthfn argument actually for? Looks like it's only used for testing? That really shouldn't be in there; I'm sure that can be set on the mock during testing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm.. hold over from prior implementations... we really need to get this in ASAP so let me excise that part in a follow up if you don't mind.
cli/command/engine/activate.go
Outdated
| _, err := client.Ping(ctx) | ||
| return err | ||
| }); err != nil { | ||
| }, clitypes.RuntimeMetadataDir); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related to my other comments about adding this option to the clitypes.EngineInitOptions; it looks like currently we only pass the default value.
We could get that default in client.ActivateEngine() / client.DoUpdate(), i.e., something like
func (c *baseClient) DoUpdate(ctx context.Context, opts clitypes.EngineInitOptions, out clitypes.OutStream,
authConfig *types.AuthConfig, healthfn func(context.Context) error) error {
if opts.MetaDataDir == "" {
opts.MetaDataDir = clitypes.RuntimeMetadataDir
}
...
}Doing so, makes the default (empty string) a useful value
|
ping @silvin-lubecki @vdemeester PTAL |
|
@thaJeztah if you're still online, could you take a quick peek? We'd like to get this in today if we can so we can cut a beta1.8 build to wrap up a number of remaining P0's. |
thaJeztah
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes SGTM, but could use some more eyes on this one
please squash the commits
79316f2 to
76f64e9
Compare
|
LGTM |
This is a follow up PR to docker#1381 to address some of the review comments we didn't get to. Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
76f64e9 to
c12e23a
Compare
andrewhsu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This is a follow up PR to #1381 to address some of the review comments
we didn't get to.
Signed-off-by: Daniel Hiltgen daniel.hiltgen@docker.com