Documentation ¶
Index ¶
- func NewDefautlEventManager() *defaultEventManager
- func NewProvReqProcessor(client *provreqclient.ProvisioningRequestClient, ...) *provReqProcessor
- func NewProvisioningRequestPodsFilter(e EventManager) pods.PodListProcessor
- type EventManager
- type ProvisioningRequestPodsFilter
- type ProvisioningRequestPodsInjector
- func (p *ProvisioningRequestPodsInjector) CleanUp()
- func (p *ProvisioningRequestPodsInjector) GetPodsFromNextRequest(isSupportedClass func(*provreqwrapper.ProvisioningRequest) bool) ([]*apiv1.Pod, error)
- func (p *ProvisioningRequestPodsInjector) IsAvailableForProvisioning(pr *provreqwrapper.ProvisioningRequest) bool
- func (p *ProvisioningRequestPodsInjector) LastProvisioningRequestProcessTime() time.Time
- func (p *ProvisioningRequestPodsInjector) MarkAsAccepted(pr *provreqwrapper.ProvisioningRequest) error
- func (p *ProvisioningRequestPodsInjector) MarkAsFailed(pr *provreqwrapper.ProvisioningRequest, reason string, message string)
- func (p *ProvisioningRequestPodsInjector) Process(_ *context.AutoscalingContext, unschedulablePods []*apiv1.Pod) ([]*apiv1.Pod, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDefautlEventManager ¶
func NewDefautlEventManager() *defaultEventManager
NewDefautlEventManager return basic event manager.
func NewProvReqProcessor ¶
func NewProvReqProcessor(client *provreqclient.ProvisioningRequestClient, predicateChecker predicatechecker.PredicateChecker) *provReqProcessor
NewProvReqProcessor return ProvisioningRequestProcessor.
func NewProvisioningRequestPodsFilter ¶
func NewProvisioningRequestPodsFilter(e EventManager) pods.PodListProcessor
NewProvisioningRequestPodsFilter creates a ProvisioningRequest filter processor.
Types ¶
type EventManager ¶
type EventManager interface { LogIgnoredInScaleUpEvent(context *context.AutoscalingContext, now time.Time, pod *apiv1.Pod, prName string) Reset() }
EventManager is an interface for handling events for provisioning request.
type ProvisioningRequestPodsFilter ¶
type ProvisioningRequestPodsFilter struct {
// contains filtered or unexported fields
}
ProvisioningRequestPodsFilter filter out pods that consumes Provisioning Request
func (*ProvisioningRequestPodsFilter) CleanUp ¶
func (p *ProvisioningRequestPodsFilter) CleanUp()
CleanUp cleans up the processor's internal structures.
func (*ProvisioningRequestPodsFilter) Process ¶
func (p *ProvisioningRequestPodsFilter) Process( context *context.AutoscalingContext, unschedulablePods []*apiv1.Pod, ) ([]*apiv1.Pod, error)
Process filters out all pods that are consuming a Provisioning Request from unschedulable pods list.
type ProvisioningRequestPodsInjector ¶
type ProvisioningRequestPodsInjector struct {
// contains filtered or unexported fields
}
ProvisioningRequestPodsInjector creates in-memory pods from ProvisioningRequest and inject them to unscheduled pods list.
func NewFakePodsInjector ¶
func NewFakePodsInjector(client *provreqclient.ProvisioningRequestClient, clock *testing.FakePassiveClock) *ProvisioningRequestPodsInjector
NewFakePodsInjector creates a new instance of ProvisioningRequestPodsInjector with the given client and clock for testing.
func NewProvisioningRequestPodsInjector ¶
func NewProvisioningRequestPodsInjector(kubeConfig *rest.Config, initialBackoffTime, maxBackoffTime time.Duration, maxCacheSize int) (*ProvisioningRequestPodsInjector, error)
NewProvisioningRequestPodsInjector creates a ProvisioningRequest filter processor.
func (*ProvisioningRequestPodsInjector) CleanUp ¶
func (p *ProvisioningRequestPodsInjector) CleanUp()
CleanUp cleans up the processor's internal structures.
func (*ProvisioningRequestPodsInjector) GetPodsFromNextRequest ¶
func (p *ProvisioningRequestPodsInjector) GetPodsFromNextRequest( isSupportedClass func(*provreqwrapper.ProvisioningRequest) bool, ) ([]*apiv1.Pod, error)
GetPodsFromNextRequest picks one ProvisioningRequest meeting the condition passed using isSupportedClass function, marks it as accepted and returns pods from it.
func (*ProvisioningRequestPodsInjector) IsAvailableForProvisioning ¶
func (p *ProvisioningRequestPodsInjector) IsAvailableForProvisioning(pr *provreqwrapper.ProvisioningRequest) bool
IsAvailableForProvisioning checks if the provisioning request is the correct state for processing and provisioning has not been attempted recently.
func (*ProvisioningRequestPodsInjector) LastProvisioningRequestProcessTime ¶
func (p *ProvisioningRequestPodsInjector) LastProvisioningRequestProcessTime() time.Time
LastProvisioningRequestProcessTime returns the time when the last provisioning request was processed.
func (*ProvisioningRequestPodsInjector) MarkAsAccepted ¶
func (p *ProvisioningRequestPodsInjector) MarkAsAccepted(pr *provreqwrapper.ProvisioningRequest) error
MarkAsAccepted marks the ProvisioningRequest as accepted.
func (*ProvisioningRequestPodsInjector) MarkAsFailed ¶
func (p *ProvisioningRequestPodsInjector) MarkAsFailed(pr *provreqwrapper.ProvisioningRequest, reason string, message string)
MarkAsFailed marks the ProvisioningRequest as failed.
func (*ProvisioningRequestPodsInjector) Process ¶
func (p *ProvisioningRequestPodsInjector) Process( _ *context.AutoscalingContext, unschedulablePods []*apiv1.Pod, ) ([]*apiv1.Pod, error)
Process pick one ProvisioningRequest, update Accepted condition and inject pods to unscheduled pods list.