X Tutup
Skip to content

Implemented LogConfig (create and inspect containers)#275

Merged
marcuslinke merged 3 commits intodocker-java:masterfrom
cdancy:master
Jul 20, 2015
Merged

Implemented LogConfig (create and inspect containers)#275
marcuslinke merged 3 commits intodocker-java:masterfrom
cdancy:master

Conversation

@cdancy
Copy link
Copy Markdown
Contributor

@cdancy cdancy commented Jul 17, 2015

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.

@cdancy
Copy link
Copy Markdown
Contributor Author

cdancy commented Jul 17, 2015

Well it passed here so I guess that's good ;)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

According to the docs config must be a Map<String, String>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@marcuslinke
Copy link
Copy Markdown
Contributor

It would be the best to have at least a test case for LogConfig in CreateContainerCmdImplTest. Any chance?

ADDED: documentation on how to use LogConfig and its available drivers.
ADDED: fleshed out LogConfig support to be more in line with other options.
@cdancy
Copy link
Copy Markdown
Contributor Author

cdancy commented Jul 18, 2015

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.

@marcuslinke
Copy link
Copy Markdown
Contributor

I think a basic test could create a container with a valid log config (like json-file) and inspect the container afterwards to check if the settings are accepted by the docker host.

@marcuslinke
Copy link
Copy Markdown
Contributor

Don't worry about failed intergration tests. CircleCI uses a quite old docker version where log config is not supported.

@cdancy
Copy link
Copy Markdown
Contributor Author

cdancy commented Jul 20, 2015

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.

@marcuslinke marcuslinke merged commit 6dd3c76 into docker-java:master Jul 20, 2015
@marcuslinke
Copy link
Copy Markdown
Contributor

@cdancy I've modified your code so the logging type is an enum now. Thanks for your contribution!

@marcuslinke marcuslinke changed the title Fix for #218 Implemented LogConfig (create and inspect containers) Jul 20, 2015
@cdancy
Copy link
Copy Markdown
Contributor Author

cdancy commented Jul 20, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

X Tutup