client

package
v0.0.2-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoTriggersFound = errors.New("no triggers found")

ErrNoTriggersFound is returned when no triggers are found.

Functions

This section is empty.

Types

type SchedulePlannerClient

type SchedulePlannerClient struct {
	Client client.Client
	Log    logr.Logger
}

SchedulePlannerClient stores schedule planner client info.

func NewPlannerClient

func NewPlannerClient(c client.Client, log logr.Logger) *SchedulePlannerClient

NewPlannerClient creates a new schedule planner client instance.

func NewSchedulePlannerClient

func NewSchedulePlannerClient(config *rest.Config, log logr.Logger) (*SchedulePlannerClient, error)

NewSchedulePlannerClient creates a new client for schedule planner resource.

func (*SchedulePlannerClient) CheckIfPodPresent

func (c *SchedulePlannerClient) CheckIfPodPresent(ctx context.Context,
	namespace,
	podset,
	podName string,
) (bool, *plannerv1alpha1.PlanSpec, error)

CheckIfPodPresent checks if podname is present in the plan spec.

func (*SchedulePlannerClient) Delete

func (c *SchedulePlannerClient) Delete(ctx context.Context, podName, namespace, podset string) (bool, error)

Delete deletes schedule planner spec by podname, namespace and podset.

func (*SchedulePlannerClient) Get

func (c *SchedulePlannerClient) Get(ctx context.Context,
	namespace, podset string) (*plannerv1alpha1.SchedulePlan, error)

Get gets the schedule planner resource by namespace and podset.

func (*SchedulePlannerClient) List

List lists the schedule planner resources by namespace and labels.

func (*SchedulePlannerClient) Update

func (c *SchedulePlannerClient) Update(ctx context.Context,
	namespace, podset string,
	assignments map[string]string,
) error

Update updates or creates planner spec assignments by namespace and podset.

func (*SchedulePlannerClient) UpdateAssignment

func (c *SchedulePlannerClient) UpdateAssignment(ctx context.Context,
	namespace, podset string,
	podName, nodeName string,
) error

UpdateAssignment updates or creates planner spec assignment for the pod with the nodename.

type ScheduleTriggerClient

type ScheduleTriggerClient struct {
	Client client.Client
	Log    logr.Logger
}

ScheduleTriggerClient saves schedule trigger client specific info.

func NewScheduleTriggerClient

func NewScheduleTriggerClient(config *rest.Config, log logr.Logger) (*ScheduleTriggerClient, error)

NewScheduleTriggerClient creates a new client for schedule trigger resource.

func NewTriggerClient

func NewTriggerClient(c client.Client, log logr.Logger) *ScheduleTriggerClient

NewTriggerClient creates a schedule trigger client instance.

func (*ScheduleTriggerClient) Get

func (c *ScheduleTriggerClient) Get(ctx context.Context,
	namespace,
	podset string,
) (*plannerv1alpha1.ScheduleTrigger, error)

Get is used to get the schedule trigger instance by namespace and podset.

func (*ScheduleTriggerClient) List

List lists the schedule trigger instances by namespace and labels.

func (*ScheduleTriggerClient) Update

func (c *ScheduleTriggerClient) Update(ctx context.Context,
	namespace,
	podset,
	state string,
) error

Update updates the schedule trigger client resource by namespace and podset.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL