taskservice

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package taskservice implement logic related to Proxmox Task.

Index

Constants

View Source
const (
	TaskInfoStateQueued     = TaskInfoState("queued")
	TaskInfoStateRunning    = TaskInfoState("running")
	TaskInfoStateUnexpected = TaskInfoState("unexpected status")
	TaskInfoStateSuccess    = TaskInfoState("success")
	TaskInfoStateOK         = TaskInfoState("OK")
	TaskInfoStateError      = TaskInfoState("error")
)

all the task states.

Variables

View Source
var (
	// ErrTaskNotFound task is not found.
	ErrTaskNotFound = errors.New("task not found")
)

Functions

func GetTask

func GetTask(ctx context.Context, machineScope *scope.MachineScope) (*proxmox.Task, error)

GetTask returns the task relative to the current action.

func NewRequeueError

func NewRequeueError(msg string, d time.Duration) error

NewRequeueError returns an error of type RequeueError.

func ReconcileInFlightTask

func ReconcileInFlightTask(ctx context.Context, machineScope *scope.MachineScope) (bool, error)

ReconcileInFlightTask determines if a task associated to the Proxmox VM object is in flight or not.

Types

type RequeueError

type RequeueError struct {
	// contains filtered or unexported fields
}

RequeueError signals that a certain time must pass before continuing reconciliation.

The duration can be retrieved with RequeueAfter.

func (*RequeueError) Error

func (r *RequeueError) Error() string

func (*RequeueError) RequeueAfter

func (r *RequeueError) RequeueAfter() time.Duration

RequeueAfter returns the duration after which the controller will requeue the object.

type TaskInfoState

type TaskInfoState string

TaskInfoState the state of the task.

Jump to

Keyboard shortcuts

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