Documentation ¶
Index ¶
- func ComposeResourceKey(o k8s.Resource) string
- func GetComputeResourceAndQuantityRequested(err error) v1.ResourceList
- func IsBackoffError(err error) bool
- func IsResourceQuotaExceeded(err error) bool
- type ComputeResourceAwareBackOffHandler
- type ComputeResourceCeilings
- type Controller
- func (m *Controller) CreateBackOffHandler(ctx context.Context, key string, backOffBaseSecond int, ...) *ComputeResourceAwareBackOffHandler
- func (m *Controller) GetBackOffHandler(key string) (*ComputeResourceAwareBackOffHandler, bool)
- func (m *Controller) GetOrCreateHandler(ctx context.Context, key string, backOffBaseSecond int, ...) *ComputeResourceAwareBackOffHandler
- type HandlerMap
- type SimpleBackOffBlocker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComposeResourceKey ¶
func GetComputeResourceAndQuantityRequested ¶
func GetComputeResourceAndQuantityRequested(err error) v1.ResourceList
func IsBackoffError ¶
func IsResourceQuotaExceeded ¶
Types ¶
type ComputeResourceAwareBackOffHandler ¶
type ComputeResourceAwareBackOffHandler struct { *SimpleBackOffBlocker *ComputeResourceCeilings }
ComputeResourceAwareBackOffHandler is an exponential back-off handler that also keeps track of the resource ceilings of the operations that are blocked or failed due to resource insufficiency
func (*ComputeResourceAwareBackOffHandler) Handle ¶
func (h *ComputeResourceAwareBackOffHandler) Handle(ctx context.Context, operation func() error, requestedResourceList v1.ResourceList) error
Act based on current backoff interval and set the next one accordingly
func (*ComputeResourceAwareBackOffHandler) IsActive ¶
func (h *ComputeResourceAwareBackOffHandler) IsActive() bool
type ComputeResourceCeilings ¶
type ComputeResourceCeilings struct {
// contains filtered or unexported fields
}
type Controller ¶
type Controller struct { // Controller.Clock allows the use of fake clock when testing Clock clock.Clock // contains filtered or unexported fields }
Controller is a name-spaced collection of back-off handlers
func NewController ¶
func NewController(ctx context.Context) *Controller
func (*Controller) CreateBackOffHandler ¶
func (m *Controller) CreateBackOffHandler(ctx context.Context, key string, backOffBaseSecond int, maxBackOffDuration time.Duration) *ComputeResourceAwareBackOffHandler
func (*Controller) GetBackOffHandler ¶
func (m *Controller) GetBackOffHandler(key string) (*ComputeResourceAwareBackOffHandler, bool)
func (*Controller) GetOrCreateHandler ¶
func (m *Controller) GetOrCreateHandler(ctx context.Context, key string, backOffBaseSecond int, maxBackOffDuration time.Duration) *ComputeResourceAwareBackOffHandler
type HandlerMap ¶
func (*HandlerMap) Get ¶
func (m *HandlerMap) Get(key string) (*ComputeResourceAwareBackOffHandler, bool)
func (*HandlerMap) Set ¶
func (m *HandlerMap) Set(key string, value *ComputeResourceAwareBackOffHandler)
Click to show internal directories.
Click to hide internal directories.