ci-tools
ci-tools copied to clipboard
ci-operator: Enable ErrTypeNotFound on the lease client
As of today, when the boskos' client tries to acquire a lease, it doesn't distinguish between these two error cases:
- There are no leases available anymore.
- The lease type we are trying to acquire simply doesn't exist.
The previous cases are both handled with the same ErrNotFound and, as a consequence, the client keeps retrying to acquire a lease even when it doesn't make any sense (the type doesn't exist).
Furthermore, with the upcoming "intra-step leasing" feature, clients want to implement the "let's try to acquire a lease of type X, if it exists" behavior, which requires the boskos' client to be able to tell whether an error is ErrNotFound or ErrTypeNotFound.