discoverer

package
v3.32.2 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPodNotFound = errors.New("pod not found")

Functions

This section is empty.

Types

type Config

type Config struct {
	PodListerer discovery.PodListerer
	NodeName    string
}

type ControlplanePodDiscoverer

type ControlplanePodDiscoverer struct {
	Config
	// contains filtered or unexported fields
}

ControlplanePodDiscoverer implements PodDiscoverer interface.

func New

func New(config Config, opts ...OptionFunc) (*ControlplanePodDiscoverer, error)

New returns an ControlplanePodDiscoverer.

func (*ControlplanePodDiscoverer) Discover

Discover returns the first Pod matching the namespace and selector from the listed pods. If MatchNode is true the Pod must be running on the same node to match.

Errors returned by this function should be managed as severe and not related to the autodiscover entry. No error is returned if no Pod has been discovered.

type OptionFunc

type OptionFunc func(c *ControlplanePodDiscoverer) error

func WithLogger

func WithLogger(logger *log.Logger) OptionFunc

WithLogger returns an OptionFunc to change the logger from the default noop logger.

type PodDiscoverer

type PodDiscoverer interface {
	// Discover returns a pod matching the selector, namespaces and
	// is in the same node if matchNode is true.
	Discover(config.AutodiscoverControlPlane) (*corev1.Pod, error)
}

PodDiscoverer is used to discover control plane components.

Jump to

Keyboard shortcuts

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