-
Notifications
You must be signed in to change notification settings - Fork 883
Give LB sandboxes predictable names #2240
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -84,6 +84,7 @@ type sandbox struct { | |
| ingress bool | ||
| ndotsSet bool | ||
| oslTypes []osl.SandboxType // slice of properties of this sandbox | ||
| loadBalancerNID string // NID that this SB is a load balancer for | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isn't this actually the network id?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this is the network ID of the network that this sandbox load balances for. Of course, this is only set if the sandbox is specifically a load balancer sandbox. Otherwise a given sandbox is most likely a container and can belong to multiple networks. |
||
| sync.Mutex | ||
| // This mutex is used to serialize service related operation for an endpoint | ||
| // The lock is here because the endpoint is saved into the store so is not unique | ||
|
|
@@ -1169,8 +1170,9 @@ func OptionIngress() SandboxOption { | |
|
|
||
| // OptionLoadBalancer function returns an option setter for marking a | ||
| // sandbox as a load balancer sandbox. | ||
| func OptionLoadBalancer() SandboxOption { | ||
| func OptionLoadBalancer(nid string) SandboxOption { | ||
| return func(sb *sandbox) { | ||
| sb.loadBalancerNID = nid | ||
| sb.oslTypes = append(sb.oslTypes, osl.SandboxTypeLoadBalancer) | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we do
lb-<id>so that is consistent with the1-of the overlay?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, not easily. The network namespaces in
/var/run/docker/netnsof the form1-XXXXXXXXXare generated within the overlay driver and don't have actuallibnetwork.Sandboxstructures associated with them. The load balancer sandboxes, by contrast, are full blownlibnetwork.Sandboxentities. I tried naming themlb-XXXXXXXXXfirst, actually, but doing so caused immediate failures. I am not sure why yet. But just changing "-" to "_" completely fixed the issue. I could change the form to beXXXXXXX_sboxperhaps if that seems preferable. WDYT?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still like more the lb prefix, it's much more explainable than the _sbox postfix