Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

weave hide/detach allocates a new address if called with no preceding expose/attach #860

Closed
bboreham opened this issue Jun 5, 2015 · 3 comments
Assignees
Milestone

Comments

@bboreham
Copy link
Contributor

bboreham commented Jun 5, 2015

This is a conscious choice, to make the script simpler, but is strictly unnecessary, and could lead to failure cases, e.g. if ipam is out of addresses.

[note that, as of current state of #827, the same will apply to detach with no preceding attach]

@rade rade added chore and removed bug labels Jun 5, 2015
@rade rade changed the title weave script will allocate a new address if you call hide with no preceding expose weave hide allocates a new address if called with no preceding expose Jun 5, 2015
@rade
Copy link
Member

rade commented Oct 2, 2015

This can also result in hangs...

$ weave launch --init-peer-count=2
$ weave hide
...(waits forever)

@rade
Copy link
Member

rade commented Oct 3, 2015

detach is similarly afflicted:

$ weave launch --init-peer-count=2
$ docker run --name=foo -dti ubuntu
5884f1daccb9e5821d82c30900f96720dbfda9001da5f5052a87a5bcb7b3c8bf
$ weave detach foo
...(waits forever)

@rade rade changed the title weave hide allocates a new address if called with no preceding expose weave hide/detach allocates a new address if called with no preceding expose/attach Oct 3, 2015
@rade rade self-assigned this Oct 3, 2015
rade added a commit that referenced this issue Oct 3, 2015
Instead of POSTing to IPAM in order to obtain IPs, we GET existing
IPs. We ignore 404s, so detaching/hiding remains idempotent.

Fixes #860
@bboreham
Copy link
Contributor Author

bboreham commented Oct 6, 2015

This can also result in hangs

On a point of history, "could lead to failure cases, e.g. if ipam is out of addresses" was correct at the time of writing, but subsequently we decided that the behaviour of IPAM on out-of-addresses should be to wait until an address is available, which gives the behaviour you see.

rade added a commit that referenced this issue Oct 6, 2015
Instead of POSTing to IPAM in order to obtain IPs, we GET existing
IPs. We ignore 404s, so detaching/hiding remains idempotent.

Fixes #860
@rade rade closed this as completed in #1503 Oct 6, 2015
rade added a commit that referenced this issue Oct 6, 2015
don't allocate IPs on 'detach' and 'hide'

Fixes #860.
@rade rade added this to the 1.2.0 milestone Oct 6, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants