HomePhabricator

When a Drydock host based on an Almanac blueprint has its binding disabled…

Description

When a Drydock host based on an Almanac blueprint has its binding disabled, stop handing out leases

Summary:
Ref T13210. Ref T12145. The "Almanac Host" blueprint currently hands out new leases on a given host even if the binding has been disabled.

Although there are some more complicated cases here (e.g., involving cleanup of the existing resource and existing leases), this one seems clear cut: if the binding has been disabled, we should stop handing out new leases on it.

Test Plan:

  • Created a service with two hosts.
  • Requested a lease, got host A.
  • Requested more leases, always got host A (we never build a new host when we don't have to, and we currently never have to).
  • Disabled the binding to host A.
  • Requested a lease.
    • Before patch: got host A.
    • After patch: got host B.
  • Also disabled the other binding to host B, requested a lease, got an indefinite wait for resources (which is expected and reasonable).

Reviewers: amckinley

Reviewed By: amckinley

Subscribers: yelirekim, PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13210, T12145

Differential Revision: https://secure.phabricator.com/D19761