Skip to content

Conversation

@aidando73
Copy link
Contributor

Fixes #1940

if (containerNetwork != null) {
if (containerNetwork != null && hostConfig.getNetworkMode() != null) {
networkingConfig = new NetworkingConfig()
.withEndpointsConfig(singletonMap(hostConfig.getNetworkMode(), containerNetwork));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exception was being thrown as we were putting:

EndpointsConfig: {
    null: containerNetwork
}

as networkMode is null by default. This can't be serialised by JSON so it throws.

Copy link
Member

@eddumelendez eddumelendez left a comment

Choose a reason for hiding this comment

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

LGTM, just waiting for @bsideup review

Copy link
Member

@bsideup bsideup left a comment

Choose a reason for hiding this comment

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

Approved with a nit 👍

@aidando73
Copy link
Contributor Author

Thank you @eddumelendez and @bsideup for the review. I've addressed your suggestions.

@bsideup bsideup added this to the next milestone Sep 13, 2022
@eddumelendez eddumelendez merged commit a961200 into docker-java:master Sep 13, 2022
@eddumelendez
Copy link
Member

Thanks for your contribution @REslim30 !

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.

Null key for a Map not allowed in JSON (use a converting NullKeySerializer?) when using network aliases

3 participants