Give LB sandboxes predictable names#2240
Conversation
| sb.config.resolvConfPath = filepath.Join(c.cfg.Daemon.DataDir, "/network/files/resolv.conf") | ||
| sb.id = "ingress_sbox" | ||
| } else if sb.loadBalancerNID != "" { | ||
| sb.id = "lb_" + sb.loadBalancerNID |
There was a problem hiding this comment.
can we do lb-<id> so that is consistent with the 1- of the overlay?
There was a problem hiding this comment.
Actually, not easily. The network namespaces in /var/run/docker/netns of the form 1-XXXXXXXXX are generated within the overlay driver and don't have actual libnetwork.Sandbox structures associated with them. The load balancer sandboxes, by contrast, are full blown libnetwork.Sandbox entities. I tried naming them lb-XXXXXXXXX first, 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 be XXXXXXX_sbox perhaps if that seems preferable. WDYT?
There was a problem hiding this comment.
I still like more the lb prefix, it's much more explainable than the _sbox postfix
| 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.
isn't this actually the network id?
There was a problem hiding this comment.
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.
Change the sandbox IDs for the sandboxes of load-balancing endpoints to be "lb_XXXXXXXXX" where XXXXXXXXX is the network ID that this sandbox load balances for. This makes it easier to find these sandboxes in /var/run/docker/netns and thus makes debugging easier. Signed-off-by: Chris Telfer <[email protected]>
|
Not sure where this error is coming from but I'm certain that the change doesn't touch the remote drivers in any way. |
|
@ctelfer the actual failure is the following: The one that you mention is just an error log but the test passes. |
Change the sandbox IDs for the sandboxes of load-balancing endpoints to be "lb_XXXXXXXXX" where XXXXXXXXX is the first 9 characters of the network ID that this sandbox load balances for. This makes it easier to find these sandboxes in /var/run/docker/netns and thus makes debugging easier.
Signed-off-by: Chris Telfer [email protected]