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 ¶
func (c *ControlplanePodDiscoverer) Discover(ad config.AutodiscoverControlPlane) (*corev1.Pod, error)
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.
Click to show internal directories.
Click to hide internal directories.