Implemented LogConfig (create and inspect containers)#275
Implemented LogConfig (create and inspect containers)#275marcuslinke merged 3 commits intodocker-java:masterfrom cdancy:master
Conversation
|
Well it passed here so I guess that's good ;) |
There was a problem hiding this comment.
It should be noted this variable does nothing through docker at the moment (and I vaguely remember talk of it being removed) and serves only to help tests run successfully.
There was a problem hiding this comment.
According to the docs config must be a Map<String, String>
|
It would be the best to have at least a test case for LogConfig in |
ADDED: documentation on how to use LogConfig and its available drivers. ADDED: fleshed out LogConfig support to be more in line with other options.
|
That's the thing: no matter what one puts in for values the command to create a container succeeds. If I put in "fake-log-driver" for type docker will not complain and just default to log-driver none. If I put in configs that have nothing to do with the type docker will just ignore them. So with that in mind I'm not sure what we could even test. On a side-note I've made the requested changes and fleshed out the support a bit more for this option to be more inline with what's already provided. I see failures with integration testing, both locally and through circle-ci, but they do not look related to my changes. |
|
I think a basic test could create a container with a valid log config (like |
|
Don't worry about failed intergration tests. CircleCI uses a quite old docker version where log config is not supported. |
|
I've added the test 'CreateContainerCmdImplTest.createContainerWithLogConfig' which sets LogConfig to 'none' and inspects the reponse to ensure that is what is actually set. Works here against my local docker instance. I added the ' @test(groups = "ignoreInCircleCi")' annotation as I assume we don't want this run on CircleCI due to it using an older docker version. |
|
@cdancy I've modified your code so the logging type is an enum now. Thanks for your contribution! |
|
Good call. I was thinking of doing the same but wasn't sure if we should force the user to pass in the Enum on the LogConfig constructor/setters or do a check to ensure the type was supported. |
6 failures running integration tests locally but they do not appear to be related to this change. All look to be coming from commands being run inside containers and returning non-zero exit codes.