Skip to main content

Additional Inventory Service Notes

As described in the previous section the invoke of the NewService function spawns a call of the newInventoryService function.

The newInventoryService function is defined in provider/cluster/inventory.go.

When the Provider's bid engine determines that it should bid on a new deployment the Reserve method is called. Downstream logic places this reservation into inventory.

In summation this Bid Engine logic is the mechanism in which the Provider reserves Kubernetes resources and places the reservation into inventory while the bid is pending.

Source code reference location

        case result := <-shouldBidCh:
....
clusterch = runner.Do(metricsutils.ObserveRunner(func() runner.Result {
v := runner.NewResult(o.cluster.Reserve(o.orderID, group))
return v
}, reservationDuration))