gather

package
v0.5.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AvailableAddons

func AvailableAddons() []string

Types

type Addon

type Addon interface {
	// Inspect a resource and gather related data.
	Inspect(*unstructured.Unstructured) error
}

func NewLogsAddon

func NewLogsAddon(backend AddonBackend) (Addon, error)

func NewPVCAddon

func NewPVCAddon(backend AddonBackend) (Addon, error)

func NewRookAddon

func NewRookAddon(backend AddonBackend) (Addon, error)

type AddonBackend

type AddonBackend interface {
	// Config returns the rest config for this cluster that can be used to
	// create a new client.
	Config() *rest.Config

	// HTTPClient returns the http client connected to the cluster. It can be
	// used to create a new client sharing the same http client.
	HTTPClient() *http.Client

	// Output returns the output for this gathering.
	Output() *OutputDirectory

	// Options returns gathering options for this cluster.
	Options() *Options

	// Queue function on the work queue.
	Queue(WorkFunc)

	// GatherResource gathers the specified resource asynchronically.
	GatherResource(schema.GroupVersionResource, types.NamespacedName)
}

type AgentPod

type AgentPod struct {
	Client *kubernetes.Clientset
	Log    *zap.SugaredLogger
	Pod    *corev1.Pod
}

func NewAgentPod

func NewAgentPod(name string, client *kubernetes.Clientset, log *zap.SugaredLogger) *AgentPod

func (*AgentPod) Create

func (a *AgentPod) Create() error

func (*AgentPod) Delete

func (a *AgentPod) Delete()

func (AgentPod) String

func (a AgentPod) String() string

func (*AgentPod) WaitUntilRunning

func (a *AgentPod) WaitUntilRunning() error

type Gatherer

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

func New

func New(config *rest.Config, directory string, opts Options) (*Gatherer, error)

func (*Gatherer) Count

func (g *Gatherer) Count() int

func (*Gatherer) Gather

func (g *Gatherer) Gather() error

type LogsAddon

type LogsAddon struct {
	AddonBackend
	// contains filtered or unexported fields
}

func (*LogsAddon) Inspect

func (a *LogsAddon) Inspect(pod *unstructured.Unstructured) error

type Options

type Options struct {
	Kubeconfig string
	Context    string
	Namespaces []string
	Addons     []string
	Log        *zap.SugaredLogger
}

type OutputDirectory

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

func (*OutputDirectory) CreateAddonDir

func (o *OutputDirectory) CreateAddonDir(name string, more ...string) (string, error)

func (*OutputDirectory) CreateClusterResource

func (o *OutputDirectory) CreateClusterResource(resource string, name string) (io.WriteCloser, error)

func (*OutputDirectory) CreateContainerLog

func (o *OutputDirectory) CreateContainerLog(namespace string, pod string, container string, name string) (io.WriteCloser, error)

func (*OutputDirectory) CreateNamespacedResource

func (o *OutputDirectory) CreateNamespacedResource(namespace string, resource string, name string) (io.WriteCloser, error)

type Queuer

type Queuer interface {
	Queue(WorkFunc)
}

type RemoteCommand

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

func NewRemoteCommand

func NewRemoteCommand(pod *corev1.Pod, opts *Options, log *zap.SugaredLogger, directroy string) *RemoteCommand

func (*RemoteCommand) Filename

func (c *RemoteCommand) Filename(command ...string) string

func (*RemoteCommand) Gather

func (c *RemoteCommand) Gather(command ...string) error

type RemoteDirectory

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

func NewRemoteDirectory

func NewRemoteDirectory(pod *corev1.Pod, opts *Options, log *zap.SugaredLogger) *RemoteDirectory

func (*RemoteDirectory) Gather

func (d *RemoteDirectory) Gather(src string, dst string) error

type RookAddon

type RookAddon struct {
	AddonBackend
	// contains filtered or unexported fields
}

func (*RookAddon) Inspect

func (a *RookAddon) Inspect(cephcluster *unstructured.Unstructured) error

type WorkFunc

type WorkFunc func() error

type WorkQueue

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

func NewWorkQueue

func NewWorkQueue(workers int, size int) *WorkQueue

func (*WorkQueue) Queue

func (q *WorkQueue) Queue(work WorkFunc)

func (*WorkQueue) Start

func (q *WorkQueue) Start()

func (*WorkQueue) Wait

func (q *WorkQueue) Wait() error

Jump to

Keyboard shortcuts

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