collectors

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MPL-2.0 Imports: 29 Imported by: 1

Documentation

Overview

Package collectors contains all standard Talos/Kubernetes state collectors used in the support bundle generator.

Index

Constants

View Source
const Cluster = "cluster"

Cluster is the const for the top level cluster collectors.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collect

type Collect func(ctx context.Context, options *bundle.Options) ([]byte, error)

Collect defines a single collect call which returns data blob to be written in the file.

type Collector

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

Collector unifies implementation of a the data collector with it's path in the archive.

func GetForOptions

func GetForOptions(ctx context.Context, options *bundle.Options) ([]*Collector, error)

GetForOptions creates all collectors for the provided bundle options.

func GetKubernetesCollectors

func GetKubernetesCollectors(client *kubernetes.Clientset) []*Collector

GetKubernetesCollectors creates all kubernetes API related collectors.

func GetTalosNodeCollectors

func GetTalosNodeCollectors(ctx context.Context, client *client.Client) ([]*Collector, error)

GetTalosNodeCollectors creates all collectors that rely on using Talos API.

func NewCollector

func NewCollector(path string, c Collect) *Collector

NewCollector creates new collector.

func WithFolder

func WithFolder(collectors []*Collector, path string) []*Collector

WithFolder appends path prefix to all collectors.

func WithNode

func WithNode(collectors []*Collector, node string) []*Collector

WithNode returns collectors which adds Talos node gRPC metadata to the context.

func WithSource

func WithSource(collectors []*Collector, source string) []*Collector

WithSource returns collectors which custom source name.

func (*Collector) Run

func (c *Collector) Run(ctx context.Context, options *bundle.Options) error

Run executes the collector.

func (*Collector) Source

func (c *Collector) Source() string

Source returns collector source name (Talos node name, cluster, etc).

func (*Collector) String

func (c *Collector) String() string

String implements fmt.Stringer interface.

Jump to

Keyboard shortcuts

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