Documentation ¶
Index ¶
- Constants
- func GetEnvVarRefValue(kc kubernetes.Interface, ns string, from *v1.EnvVarSource, ...) (string, error)
- type BaseNotifier
- type InformerOption
- func RestrictNode(nodeName string) InformerOption
- func WaitForCacheSync() InformerOption
- func WithCacheSyncTimeout(to time.Duration) InformerOption
- func WithKubeClient(client kubernetes.Interface) InformerOption
- func WithKubeConfigPath(path string) InformerOption
- func WithResyncPeriod(period time.Duration) InformerOption
- func WithoutNodes() InformerOption
- func WithoutServices() InformerOption
- type Informers
- type Notifier
- type Observer
Constants ¶
View Source
const ( EnvServiceName = "OTEL_SERVICE_NAME" EnvResourceAttrs = "OTEL_RESOURCE_ATTRIBUTES" )
Variables ¶
This section is empty.
Functions ¶
func GetEnvVarRefValue ¶
func GetEnvVarRefValue(kc kubernetes.Interface, ns string, from *v1.EnvVarSource, obj metav1.ObjectMeta) (string, error)
Code adopted from https://github.com/kubernetes/kubectl/blob/master/pkg/cmd/set/env/env_resolve.go#L248
Types ¶
type BaseNotifier ¶
type BaseNotifier struct {
// contains filtered or unexported fields
}
func NewBaseNotifier ¶
func NewBaseNotifier(log *slog.Logger) BaseNotifier
func (*BaseNotifier) Notify ¶
func (i *BaseNotifier) Notify(event *informer.Event)
func (*BaseNotifier) Subscribe ¶
func (i *BaseNotifier) Subscribe(observer Observer)
func (*BaseNotifier) Unsubscribe ¶
func (i *BaseNotifier) Unsubscribe(observer Observer)
type InformerOption ¶
type InformerOption func(*informersConfig)
func RestrictNode ¶ added in v1.9.3
func RestrictNode(nodeName string) InformerOption
func WaitForCacheSync ¶
func WaitForCacheSync() InformerOption
func WithCacheSyncTimeout ¶
func WithCacheSyncTimeout(to time.Duration) InformerOption
func WithKubeClient ¶
func WithKubeClient(client kubernetes.Interface) InformerOption
func WithKubeConfigPath ¶
func WithKubeConfigPath(path string) InformerOption
func WithResyncPeriod ¶
func WithResyncPeriod(period time.Duration) InformerOption
func WithoutNodes ¶
func WithoutNodes() InformerOption
func WithoutServices ¶
func WithoutServices() InformerOption
type Informers ¶
type Informers struct { BaseNotifier // contains filtered or unexported fields }
func InitInformers ¶
func InitInformers(ctx context.Context, opts ...InformerOption) (*Informers, error)
type Notifier ¶
type Notifier interface { Subscribe(observer Observer) Unsubscribe(observer Observer) Notify(event *informer.Event) }
Notifier can get subscriptions from Observers
type Observer ¶
type Observer interface { ID() string // On new event. If the observer returns an error, it will be assumed as invalid and will be automatically // unsubscribed from the notifier. The Observer implementation should free its occupied resources and finish // its execution On(event *informer.Event) error }
Observer can be subscribed to a Notifier to receive events
Click to show internal directories.
Click to hide internal directories.