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

Add advertise-address flag to handle the scheduler being behind a NAT #102

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

lclarkmichalek
Copy link

@lclarkmichalek lclarkmichalek commented Jul 2, 2016

In cases where the Docker daemon puts containers behind a NAT, the agent needs to use a different address to the address that is bound on to get the executor and related binaries. This change adds an 'advertise-address' flag that allow you to specify this.

I would have loved to call this flag address, and move the current address flag to bind-address or something, but I don't know how compatible that would be?

@lclarkmichalek lclarkmichalek changed the title Add exteriorAddress flag to handle BRIDGE networks Add advertise-address flag to handle the scheduler being behind a NAT Jul 4, 2016
@@ -122,12 +124,16 @@ func main() {
}
}

if *advertiseAddress == "" {
*advertiseAddress = *address
Copy link
Contributor

Choose a reason for hiding this comment

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

this smells hacky

Copy link
Author

Choose a reason for hiding this comment

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

I pretty much copied the *address default assignment logic, which felt a little hacky also :/ This simply duplicates the current logic though

Copy link
Contributor

Choose a reason for hiding this comment

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

ack. i should have scrolled up! the address logic could easily be rolled into a defaultAddress() func since it doesn't depend on any internal vars. this advertiseAddress value is basically defaulting to the value of another flag. it's not quite duplicating existing logic because PublishedAddress below will always have a value now. I'd rather see that param unset if the advertiseAddress flag is unspecified. does that make sense?

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, that's true. I don't believe the semantics will be different, but then I haven't tested it, so I'll happily update below to not set PublishedAddress if advertiseAddress is empty/nil :)

@jdef
Copy link
Contributor

jdef commented Jul 5, 2016

thanks for the PR, left some comments

…on, only set PublishedAddress when advertiseAddress is explicitly set
@lclarkmichalek
Copy link
Author

Not 100% sure that's exactly what you wanted. Used the explicitAdvertise var to indicate if the advertiseAddress flag was ever set to anything different.

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