Skip to content
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

Ensure gateway IP is truthy before adding to docker args #1174

Merged
merged 5 commits into from Apr 13, 2022

Conversation

rwynn
Copy link
Contributor

@rwynn rwynn commented Feb 10, 2021

Description

I am running into a situation on a linux server where the docker network inspect bridge --format '{{(index .IPAM.Config 0).Gateway}}' command is only returning the Subnet key in the config and not also the Gateway key as expected.

I don't have control over this particular CI server so I don't know why that is the case. However, this causes the docker create command to fail with an invalid argument for --add-host.

This change ensures the gateway IP is truthy before adding to the docker command.

Motivation and Context

This change ensures the output of docker network inspect bridge --format '{{(index .IPAM.Config 0).Gateway}}' is truthy before adding it to the docker create command.

How Has This Been Tested?

This has been tested by running a go lambda on a linux server via serverless offline --useDocker.

@dherault
Copy link
Owner

That's a yes!

@dherault dherault merged commit 3c70234 into dherault:master Apr 13, 2022
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.

None yet

2 participants