v1

package
v1.3.2-rc2 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromAlertmanagerHandlerToHandler

func FromAlertmanagerHandlerToHandler(sync AlertmanagerHandler) generic.Handler

func FromPrometheusHandlerToHandler

func FromPrometheusHandlerToHandler(sync PrometheusHandler) generic.Handler

func RegisterAlertmanagerGeneratingHandler added in v1.2.2

func RegisterAlertmanagerGeneratingHandler(ctx context.Context, controller AlertmanagerController, apply apply.Apply,
	condition condition.Cond, name string, handler AlertmanagerGeneratingHandler, opts *generic.GeneratingHandlerOptions)

RegisterAlertmanagerGeneratingHandler configures a AlertmanagerController to execute a AlertmanagerGeneratingHandler for every events observed, passing the returned objects to the provided apply.Apply. If a non-empty condition is provided, it will be updated in the status conditions for every handler execution

func RegisterAlertmanagerStatusHandler added in v1.2.2

func RegisterAlertmanagerStatusHandler(ctx context.Context, controller AlertmanagerController, condition condition.Cond, name string, handler AlertmanagerStatusHandler)

RegisterAlertmanagerStatusHandler configures a AlertmanagerController to execute a AlertmanagerStatusHandler for every events observed. If a non-empty condition is provided, it will be updated in the status conditions for every handler execution

func RegisterPrometheusGeneratingHandler added in v1.1.2

func RegisterPrometheusGeneratingHandler(ctx context.Context, controller PrometheusController, apply apply.Apply,
	condition condition.Cond, name string, handler PrometheusGeneratingHandler, opts *generic.GeneratingHandlerOptions)

RegisterPrometheusGeneratingHandler configures a PrometheusController to execute a PrometheusGeneratingHandler for every events observed, passing the returned objects to the provided apply.Apply. If a non-empty condition is provided, it will be updated in the status conditions for every handler execution

func RegisterPrometheusStatusHandler added in v1.1.2

func RegisterPrometheusStatusHandler(ctx context.Context, controller PrometheusController, condition condition.Cond, name string, handler PrometheusStatusHandler)

RegisterPrometheusStatusHandler configures a PrometheusController to execute a PrometheusStatusHandler for every events observed. If a non-empty condition is provided, it will be updated in the status conditions for every handler execution

func UpdateAlertmanagerDeepCopyOnChange

func UpdateAlertmanagerDeepCopyOnChange(client AlertmanagerClient, obj *v1.Alertmanager, handler func(obj *v1.Alertmanager) (*v1.Alertmanager, error)) (*v1.Alertmanager, error)

func UpdatePrometheusDeepCopyOnChange

func UpdatePrometheusDeepCopyOnChange(client PrometheusClient, obj *v1.Prometheus, handler func(obj *v1.Prometheus) (*v1.Prometheus, error)) (*v1.Prometheus, error)

Types

type AlertmanagerCache

type AlertmanagerCache interface {
	Get(namespace, name string) (*v1.Alertmanager, error)
	List(namespace string, selector labels.Selector) ([]*v1.Alertmanager, error)

	AddIndexer(indexName string, indexer AlertmanagerIndexer)
	GetByIndex(indexName, key string) ([]*v1.Alertmanager, error)
}

type AlertmanagerClient

type AlertmanagerClient interface {
	Create(*v1.Alertmanager) (*v1.Alertmanager, error)
	Update(*v1.Alertmanager) (*v1.Alertmanager, error)
	UpdateStatus(*v1.Alertmanager) (*v1.Alertmanager, error)
	Delete(namespace, name string, options *metav1.DeleteOptions) error
	Get(namespace, name string, options metav1.GetOptions) (*v1.Alertmanager, error)
	List(namespace string, opts metav1.ListOptions) (*v1.AlertmanagerList, error)
	Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error)
	Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Alertmanager, err error)
}

type AlertmanagerController

type AlertmanagerController interface {
	generic.ControllerMeta
	AlertmanagerClient

	OnChange(ctx context.Context, name string, sync AlertmanagerHandler)
	OnRemove(ctx context.Context, name string, sync AlertmanagerHandler)
	Enqueue(namespace, name string)
	EnqueueAfter(namespace, name string, duration time.Duration)

	Cache() AlertmanagerCache
}

func NewAlertmanagerController

func NewAlertmanagerController(gvk schema.GroupVersionKind, resource string, namespaced bool, controller controller.SharedControllerFactory) AlertmanagerController

type AlertmanagerGeneratingHandler added in v1.2.2

type AlertmanagerGeneratingHandler func(obj *v1.Alertmanager, status v1.AlertmanagerStatus) ([]runtime.Object, v1.AlertmanagerStatus, error)

AlertmanagerGeneratingHandler is the top-level handler that is executed for every Alertmanager event. It extends AlertmanagerStatusHandler by a returning a slice of child objects to be passed to apply.Apply

type AlertmanagerHandler

type AlertmanagerHandler func(string, *v1.Alertmanager) (*v1.Alertmanager, error)

type AlertmanagerIndexer

type AlertmanagerIndexer func(obj *v1.Alertmanager) ([]string, error)

type AlertmanagerStatusHandler added in v1.2.2

type AlertmanagerStatusHandler func(obj *v1.Alertmanager, status v1.AlertmanagerStatus) (v1.AlertmanagerStatus, error)

AlertmanagerStatusHandler is executed for every added or modified Alertmanager. Should return the new status to be updated

type Interface

type Interface interface {
	Alertmanager() AlertmanagerController
	Prometheus() PrometheusController
}

func New

func New(controllerFactory controller.SharedControllerFactory) Interface

type PrometheusCache

type PrometheusCache interface {
	Get(namespace, name string) (*v1.Prometheus, error)
	List(namespace string, selector labels.Selector) ([]*v1.Prometheus, error)

	AddIndexer(indexName string, indexer PrometheusIndexer)
	GetByIndex(indexName, key string) ([]*v1.Prometheus, error)
}

type PrometheusClient

type PrometheusClient interface {
	Create(*v1.Prometheus) (*v1.Prometheus, error)
	Update(*v1.Prometheus) (*v1.Prometheus, error)
	UpdateStatus(*v1.Prometheus) (*v1.Prometheus, error)
	Delete(namespace, name string, options *metav1.DeleteOptions) error
	Get(namespace, name string, options metav1.GetOptions) (*v1.Prometheus, error)
	List(namespace string, opts metav1.ListOptions) (*v1.PrometheusList, error)
	Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error)
	Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Prometheus, err error)
}

type PrometheusController

type PrometheusController interface {
	generic.ControllerMeta
	PrometheusClient

	OnChange(ctx context.Context, name string, sync PrometheusHandler)
	OnRemove(ctx context.Context, name string, sync PrometheusHandler)
	Enqueue(namespace, name string)
	EnqueueAfter(namespace, name string, duration time.Duration)

	Cache() PrometheusCache
}

func NewPrometheusController

func NewPrometheusController(gvk schema.GroupVersionKind, resource string, namespaced bool, controller controller.SharedControllerFactory) PrometheusController

type PrometheusGeneratingHandler added in v1.1.2

type PrometheusGeneratingHandler func(obj *v1.Prometheus, status v1.PrometheusStatus) ([]runtime.Object, v1.PrometheusStatus, error)

PrometheusGeneratingHandler is the top-level handler that is executed for every Prometheus event. It extends PrometheusStatusHandler by a returning a slice of child objects to be passed to apply.Apply

type PrometheusHandler

type PrometheusHandler func(string, *v1.Prometheus) (*v1.Prometheus, error)

type PrometheusIndexer

type PrometheusIndexer func(obj *v1.Prometheus) ([]string, error)

type PrometheusStatusHandler added in v1.1.2

type PrometheusStatusHandler func(obj *v1.Prometheus, status v1.PrometheusStatus) (v1.PrometheusStatus, error)

PrometheusStatusHandler is executed for every added or modified Prometheus. Should return the new status to be updated

Jump to

Keyboard shortcuts

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