handler

package
v0.0.0-...-26d813d Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 24 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dependencies

type Dependencies struct {
	KubeClient       kubernetes.Interface
	KusciaClient     kusciaclientset.Interface
	TrgLister        kuscialistersv1alpha1.TaskResourceGroupLister
	NamespacesLister corelisters.NamespaceLister
	PodsLister       corelisters.PodLister
	ServicesLister   corelisters.ServiceLister
	ConfigMapLister  corelisters.ConfigMapLister
	AppImagesLister  kuscialistersv1alpha1.AppImageLister
	Recorder         record.EventRecorder
}

Dependencies defines some parameter dependencies of functions.

type FailedHandler

type FailedHandler struct {
	*FinishedHandler
	// contains filtered or unexported fields
}

FailedHandler is used to handle kuscia task which phase is failed.

func NewFailedHandler

func NewFailedHandler(deps *Dependencies, finishedHandler *FinishedHandler) *FailedHandler

NewFailedHandler returns a FailedHandler instance.

func (*FailedHandler) Handle

func (h *FailedHandler) Handle(kusciaTask *kusciaapisv1alpha1.KusciaTask) (bool, error)

Handle is used to perform the real logic.

type FinishedHandler

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

FinishedHandler is used to handle finished kuscia task.

func NewFinishedHandler

func NewFinishedHandler(deps *Dependencies) *FinishedHandler

NewFinishedHandler returns a FinishedHandler instance.

func (*FinishedHandler) DeleteTaskResources

func (h *FinishedHandler) DeleteTaskResources(kusciaTask *kusciaapisv1alpha1.KusciaTask) error

DeleteTaskResources is used to delete task resources.

func (*FinishedHandler) Handle

func (h *FinishedHandler) Handle(kusciaTask *kusciaapisv1alpha1.KusciaTask) (bool, error)

Handle is used to perform the real logic.

type KusciaTaskPhaseHandler

type KusciaTaskPhaseHandler interface {
	Handle(kusciaTask *kusciaapisv1alpha1.KusciaTask) (bool, error)
}

KusciaTaskPhaseHandler is an interface to handle kuscia task.

type KusciaTaskPhaseHandlerFactory

type KusciaTaskPhaseHandlerFactory struct {
	KusciaTaskStateHandlerMap map[kusciaapisv1alpha1.KusciaTaskPhase]KusciaTaskPhaseHandler
}

KusciaTaskPhaseHandlerFactory is a factory to get phase handler by task resource group phase.

func NewKusciaTaskPhaseHandlerFactory

func NewKusciaTaskPhaseHandlerFactory(deps *Dependencies) *KusciaTaskPhaseHandlerFactory

NewKusciaTaskPhaseHandlerFactory returns a KusciaTaskPhaseHandlerFactory instance.

func (*KusciaTaskPhaseHandlerFactory) GetKusciaTaskPhaseHandler

GetKusciaTaskPhaseHandler is used to get KusciaTaskPhaseHandler by KusciaTaskPhase.

type PartyKitInfo

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

type PendingHandler

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

PendingHandler is used to handle kuscia task which phase is pending.

func NewPendingHandler

func NewPendingHandler(deps *Dependencies) *PendingHandler

NewPendingHandler returns a PendingHandler instance.

func (*PendingHandler) Handle

func (h *PendingHandler) Handle(kusciaTask *kusciaapisv1alpha1.KusciaTask) (needUpdate bool, err error)

Handle is used to perform the real logic.

type PodKitInfo

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

type PortService

type PortService map[string]string

type RunningHandler

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

RunningHandler is used to handle kuscia task which phase is running.

func NewRunningHandler

func NewRunningHandler(deps *Dependencies) *RunningHandler

NewRunningHandler returns a RunningHandler instance.

func (*RunningHandler) Handle

func (h *RunningHandler) Handle(kusciaTask *kusciaapisv1alpha1.KusciaTask) (bool, error)

Handle is used to perform the real logic.

type SucceededHandler

type SucceededHandler struct {
	*FinishedHandler
}

SucceededHandler is used to handle kuscia task which phase is Succeeded.

func NewSucceededHandler

func NewSucceededHandler(finishedHandler *FinishedHandler) *SucceededHandler

NewSucceededHandler returns a SucceededHandler instance.

func (*SucceededHandler) Handle

func (s *SucceededHandler) Handle(kusciaTask *kusciaapisv1alpha1.KusciaTask) (bool, error)

Handle is used to perform the real logic.

Jump to

Keyboard shortcuts

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