controller

package
v0.0.0-...-426d1e8 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Log Formats
	ControllerLogFormat = monitoring.NewTaskFormatter("len=%v")
	LogQueueFormat      = "op=" +
		operationInformerEvents +
		" " +
		monitoring.NewTaskFormatter("controller=%v cluster=%v len=%v")
)

Functions

func GetDeploymentGlobalIdentifier

func GetDeploymentGlobalIdentifier(deployment *k8sAppsV1.Deployment) string

func GetDeploymentIdentityPartition

func GetDeploymentIdentityPartition(deployment *k8sAppsV1.Deployment) string

func GetDeploymentOriginalIdentifier

func GetDeploymentOriginalIdentifier(deployment *k8sAppsV1.Deployment) string

func HandleAddUpdateDeployment

func HandleAddUpdateDeployment(ctx context.Context, obj interface{}, d *DeploymentController) error

func NewDeploymentCache

func NewDeploymentCache() *deploymentCache

Types

type Controller

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

func NewController

func NewController(name, clusterEndpoint string, stopCh <-chan struct{}, delegator Delegator, informer cache.SharedIndexInformer) Controller

func (*Controller) Run

func (c *Controller) Run(stopCh <-chan struct{})

Run starts the controller until it receives a message over stopCh

type Delegator

type Delegator interface {
	Added(context.Context, interface{}) error
	Updated(context.Context, interface{}, interface{}) error
	Deleted(context.Context, interface{}) error
	UpdateProcessItemStatus(interface{}, string) error
	GetProcessItemStatus(interface{}) (string, error)
	LogValueOfAdmiralIoIgnore(interface{})
	Get(ctx context.Context, isRetry bool, obj interface{}) (interface{}, error)
}

Delegator interface contains the methods that are required

type DeploymentClusterEntry

type DeploymentClusterEntry struct {
	Identity    string
	Deployments map[string]*DeploymentItem
}

type DeploymentController

type DeploymentController struct {
	K8sClient         kubernetes.Interface
	DeploymentHandler DeploymentHandler
	Cache             *deploymentCache
	// contains filtered or unexported fields
}

func NewDeploymentController

func NewDeploymentController(stopCh <-chan struct{}, handler DeploymentHandler, config *rest.Config, resyncPeriod time.Duration, clientLoader client.ClientLoader) (*DeploymentController, error)

func (*DeploymentController) Added

func (d *DeploymentController) Added(ctx context.Context, obj interface{}) error

func (*DeploymentController) Deleted

func (d *DeploymentController) Deleted(ctx context.Context, obj interface{}) error

func (*DeploymentController) Get

func (d *DeploymentController) Get(ctx context.Context, isRetry bool, obj interface{}) (interface{}, error)

func (*DeploymentController) GetDeploymentBySelectorInNamespace

func (d *DeploymentController) GetDeploymentBySelectorInNamespace(ctx context.Context, serviceSelector map[string]string, namespace string) []k8sAppsV1.Deployment

func (*DeploymentController) GetProcessItemStatus

func (d *DeploymentController) GetProcessItemStatus(obj interface{}) (string, error)

func (*DeploymentController) LogValueOfAdmiralIoIgnore

func (d *DeploymentController) LogValueOfAdmiralIoIgnore(obj interface{})

func (*DeploymentController) UpdateProcessItemStatus

func (d *DeploymentController) UpdateProcessItemStatus(obj interface{}, status string) error

func (*DeploymentController) Updated

func (d *DeploymentController) Updated(ctx context.Context, obj interface{}, oldObj interface{}) error

type DeploymentHandler

type DeploymentHandler interface {
	Added(ctx context.Context, obj *k8sAppsV1.Deployment) error
	Deleted(ctx context.Context, obj *k8sAppsV1.Deployment) error
}

DeploymentHandler interface contains the methods that are required

type DeploymentItem

type DeploymentItem struct {
	Deployment *k8sAppsV1.Deployment
	Status     string
}

type EventType

type EventType string
const (
	Add    EventType = "Add"
	Update EventType = "Update"
	Delete EventType = "Delete"
)

type InformerCacheObj

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

Jump to

Keyboard shortcuts

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