tumblr / collins

groovy kind of love
tumblr.github.com/collins
Apache License 2.0
572 stars 99 forks source link

AddressPool name conversion should always handle defaultPoolName correctly #527

Closed byxorna closed 7 years ago

byxorna commented 7 years ago

Fixes #416

This makes sure that we always map the pool name of an AddressPool to the DefaultPoolName if necessary, to avoid referring to implicit pools as "" some places, and by DefaultPoolName in others. The specific way this manifested was IP allocation requests for the default pool name (i.e. by using c.ipaddress_allocate!(:mytag, 'DEFAULT') would fail if ipAddress.defaultPoolName=DEFAULT, despite there being a pool with that name.

I ran into this deploying a collins instance into a topology that had only a single L2 network. I attempted to use the default pool, but found I was unable to allocate IPs from it until I renamed it.

NOTE: i have some unit tests to confirm this behavior, but I am unable to figure out how to override play configuration with WithApplication(FakeApplication(Map(additionalConfigHere))) in specs. Ill keep poking at it, but the change here has been manually verified and confirmed to fix #416.

@qx-xp @roymarantz @defect @michaeljs1990