controllers

package
v0.0.0-...-a423d60 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirectorClient

type DirectorClient interface {
	typesbroker.ApplicationLister
	UpdateOperation(ctx context.Context, request *director.Request) error
}

DirectorClient defines a Director client which is capable of fetching an application and notifying Director for operation state changes

type KubernetesClient

type KubernetesClient interface {
	Get(ctx context.Context, key client.ObjectKey) (*v1alpha1.Operation, error)
	Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error
}

KubernetesClient is a defines a Kubernetes client capable of retrieving and deleting resources as well as updating their status

type OperationReconciler

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

OperationReconciler reconciles an Operation object

func NewOperationReconciler

func NewOperationReconciler(config *webhook.Config, statusManager StatusManager, k8sClient KubernetesClient, directorClient DirectorClient, webhookClient WebhookClient, collector *metrics.Collector) *OperationReconciler

func (*OperationReconciler) Reconcile

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

Reconcile contains the Operations Controller logic concerned with processing and executing webhooks based on Operation CRs

func (*OperationReconciler) SetupWithManager

func (r *OperationReconciler) SetupWithManager(mgr ctrl.Manager) error

type StatusManager

type StatusManager interface {
	Initialize(ctx context.Context, operation *v1alpha1.Operation) error
	InProgressWithPollURL(ctx context.Context, operation *v1alpha1.Operation, pollURL string) error
	InProgressWithPollURLAndLastPollTimestamp(ctx context.Context, operation *v1alpha1.Operation, pollURL, lastPollTimestamp string, retryCount int) error
	SuccessStatus(ctx context.Context, operation *v1alpha1.Operation) error
	FailedStatus(ctx context.Context, operation *v1alpha1.Operation, errorMsg string) error
}

StatusManager defines an abstraction for managing the status of a given kubernetes resource

type WebhookClient

type WebhookClient interface {
	Do(ctx context.Context, request webhookclient.WebhookRequest) (*webhookdir.Response, error)
	Poll(ctx context.Context, request *webhookclient.PollRequest) (*webhookdir.ResponseStatus, error)
}

WebhookClient defines a general purpose Webhook executor client

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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