task

package
v1.24.6 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnnotationEdgeTaskResourcesHash = "edge.kubegems.io/resources-hash"
	AnnotationEdgeTaskNameNamespace = "edge.kubegems.io/edge-task"
)
View Source
const (
	IndexFieldEdgeTaskStatusPhase         = "status.phase"
	IndexFieldEdgeTaskSpecEdgeClusterName = "spec.edgeClusterName"
	IndexFieldEdgeClusterStatusPhase      = "status.phase"
)
View Source
const DefaultEdgeResourceQueueSize = 1024

Variables

This section is empty.

Functions

func CheckStatus

func CheckStatus(ctx context.Context, status *edgev1beta1.EdgeTaskResourceStatus, edgeresource client.Object, edgecli client.Client)

func EdgeClusterTrigger

func EdgeClusterTrigger(ctx context.Context, cli client.Client) handler.EventHandler

func EdgeTaskResourceEventsFromEvents

func EdgeTaskResourceEventsFromEvents(events []corev1.Event) []edgev1beta1.EdgeTaskResourceEvent

func ExtractEdgeTask

func ExtractEdgeTask(obj client.Object) (name string, namespace string)

func FindOwnerControllerRecursively

func FindOwnerControllerRecursively(ctx context.Context, cli client.Client, obj client.Object) (client.Object, error)

func HashResources

func HashResources(obj any) string

func InjectEdgeTask

func InjectEdgeTask(obj client.Object, edgetask *edgev1beta1.EdgeTask)

func ParseResources

func ParseResources(resources []runtime.RawExtension) ([]*unstructured.Unstructured, error)

func ParseResourcesTyped

func ParseResourcesTyped(resources []runtime.RawExtension, schema *runtime.Scheme) ([]client.Object, error)

func RemoveEdgeTaskCondition

func RemoveEdgeTaskCondition(status *edgev1beta1.EdgeTaskStatus, conditionType edgev1beta1.EdgeTaskConditionType)

func Run

func Run(ctx context.Context, options *Options) error

func UpdateEdgeTaskCondition

func UpdateEdgeTaskCondition(task *edgev1beta1.EdgeTask, condition edgev1beta1.EdgeTaskCondition)

Types

type EdgeClientsHolder

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

func NewEdgeClientsHolder

func NewEdgeClientsHolder(ctx context.Context, server string) (*EdgeClientsHolder, error)

func (*EdgeClientsHolder) Get

func (c *EdgeClientsHolder) Get(uid string) (client.Client, error)

func (*EdgeClientsHolder) Invalid

func (c *EdgeClientsHolder) Invalid(uid string)

func (*EdgeClientsHolder) SourceFunc

func (c *EdgeClientsHolder) SourceFunc(ctx context.Context, cli client.Client) source.Func

Start behaves like controller-runtime's source.Source interface

type EdgeClusterEvent

type EdgeClusterEvent struct {
	UID           string
	TaskName      string
	TaskNamespace string
}

type EdgeClusterResourceChangedCallback

type EdgeClusterResourceChangedCallback func(uid string, obj client.Object)

type Options

type Options struct {
	MaxConcurrentReconciles int    `json:"maxConcurrentReconciles,omitempty"`
	HealthProbeBindAddress  string `json:"healthProbeBindAddress,omitempty"`
	MetricsBindAddress      string `json:"metricsBindAddress,omitempty"`
	EdgeServerAddr          string `json:"edgeServerAddr,omitempty"`
	EdgeNamespace           string `json:"edgeNamespace,omitempty"`
}

func NewDefaultOptions

func NewDefaultOptions() *Options

type Reconciler

type Reconciler struct {
	client.Client
	EdgeClients *EdgeClientsHolder
}

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*Reconciler) SetupWithManager

func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options *Options) error

nolint: forcetypeassert

Jump to

Keyboard shortcuts

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