status

package
v1.23.0-cx Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UpdateStatusRetryAttempts = 5
	UpdateStatusRetryDelay    = 200 * time.Millisecond
)

Variables

This section is empty.

Functions

func Init

func Init(ctx context.Context)

Types

type StatusUpdater

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

StatusUpdater defines the updater of the node task status.

func GetConfigeUpdateJobStatusUpdater

func GetConfigeUpdateJobStatusUpdater() *StatusUpdater

func GetImagePrePullJobStatusUpdater

func GetImagePrePullJobStatusUpdater() *StatusUpdater

func GetNodeUpgradeJobStatusUpdater

func GetNodeUpgradeJobStatusUpdater() *StatusUpdater

func NewStatusUpdater

func NewStatusUpdater(
	ctx context.Context,
	tryUpdate TryUpdateFun,
) *StatusUpdater

NewStatusUpdater returns a new StatusUpdater.

func (*StatusUpdater) UpdateStatus

func (u *StatusUpdater) UpdateStatus(opts UpdateStatusOptions)

UpdateStatus sends the UpdateStatusOptions to the channel. Must call the WatchUpdateChannel() method before calling this method.

func (*StatusUpdater) WatchUpdateChannel

func (u *StatusUpdater) WatchUpdateChannel()

WatchUpdateChannel watches the update channel and updates the status of the node task. It will retry the update operation if the update fails.

type TryUpdateFun

type TryUpdateFun func(ctx context.Context, cli crdcliset.Interface, opts TryUpdateStatusOptions) error

TryUpdateFun defines the function type for updating the status.

type TryUpdateStatusOptions

type TryUpdateStatusOptions struct {
	// JobName is the name of the node job.
	JobName string
	// NodeName is the name of the edge node.
	NodeName string
	// Phase is the phase of the node task.
	Phase operationsv1alpha2.NodeTaskPhase
	// Reason is the failure reason of the node task.
	Reason string
	// ExtendInfo is the extended reporting information.
	ExtendInfo string
	// ActionStatus is the action status of the node task.
	// I.e., *ImagePrePullJobActionStatus or *NodeUpgradeJobActionStatus,
	// or the action status of other node jobs that must be a pointer structure.
	ActionStatus any
}

TryUpdateStatusOptions defines options for function of try to update status.

type UpdateStatusOptions

type UpdateStatusOptions struct {
	// Callback is the callback function of UpdateStatus(..). It will report the result of updating the status.
	Callback func(err error)

	TryUpdateStatusOptions
}

UpdateStatusOptions defines options for update status.

Jump to

Keyboard shortcuts

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