kubernetes

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: MIT Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PluginName is the name of the Kubernetes Botkube plugin.
	PluginName = "kubernetes"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client Kubernetes client

func NewClient

func NewClient(kubeConfigBytes []byte) (*Client, error)

NewClient initializes Kubernetes client

type EventCommandsGetter

type EventCommandsGetter interface {
	GetCommandsForEvent(event event.Event) ([]commander.Command, error)
}

type MessageBuilder

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

func NewMessageBuilder

func NewMessageBuilder(isInteractivitySupported bool, log logrus.FieldLogger, commandsGetter EventCommandsGetter) *MessageBuilder

func (*MessageBuilder) FromEvent

func (m *MessageBuilder) FromEvent(event event.Event, actions []config.ExtraButtons) (api.Message, error)

type RecommendationFactory

type RecommendationFactory interface {
	New(cfg config.Config) (recommendation.AggregatedRunner, config.Recommendations)
}

type Router

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

Router maintains handled event types from registered informers

func NewRouter

func NewRouter(mapper meta.RESTMapper, dynamicCli dynamic.Interface, log logrus.FieldLogger) *Router

NewRouter creates a new router to use for routing event types to registered informers.

func (*Router) BuildTable

func (r *Router) BuildTable(cfg *config.Config) *Router

BuildTable builds the routers routing table marking it ready to register, map and handle informer events.

func (*Router) HandleMappedEvent

func (r *Router) HandleMappedEvent(ctx context.Context, s Source, targetEvent config.EventType, handlerFn eventHandler)

HandleMappedEvent allows router clients to create handlers that are triggered for a target mapped event.

func (*Router) MapWithEventsInformer

func (r *Router) MapWithEventsInformer(srcEvent config.EventType, dstEvent config.EventType, handler registrationHandler) error

MapWithEventsInformer allows resources to report on an event (srcEvent) that can only be observed by watching the general k8s v1/events resource using a different event (dstEvent).

For example, you can report the "error" EventType for a resource by having the router watch/interrogate the "warning" EventType reported by the v1/events resource.

func (*Router) RegisterEventHandler

func (r *Router) RegisterEventHandler(ctx context.Context, s Source, eventType config.EventType, handlerFn func(ctx context.Context, s Source, e event.Event, updateDiffs []string))

RegisterEventHandler allows router clients to create handlers that are triggered for a target event.

func (*Router) RegisterInformers

func (r *Router) RegisterInformers(targetEvents []config.EventType, handler registrationHandler) error

RegisterInformers register informers for all the resources that match the target events.

type Source

type Source struct {
	source.HandleExternalRequestUnimplemented
	// contains filtered or unexported fields
}

Source Kubernetes source plugin data structure

func NewSource

func NewSource(version string) *Source

NewSource returns a new instance of Source.

func (*Source) Metadata

func (s *Source) Metadata(_ context.Context) (api.MetadataOutput, error)

Metadata returns metadata of Kubernetes configuration

func (*Source) Stream

Stream streams Kubernetes events

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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