kubernetes

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Kubeconfig = filepath.Join(os.Getenv("HOME"), ".kube", "config")
)

Functions

This section is empty.

Types

type BackupPod

type BackupPod struct {
	Command       string
	PodName       string
	ContainerName string
	Namespace     string
	FileExtension string
}

BackupPod contains all information nessecary to execute the backupcommands.

type ExecData

type ExecData struct {
	Reader *io.PipeReader
	Done   chan bool
}

func PodExec

func PodExec(pod BackupPod, log logr.Logger) (*ExecData, error)

PodExec sends the command to the specified pod and returns a bytes buffer with the stdout

type PodLister

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

PodLister holds the state for listing the pods.

func NewPodLister

func NewPodLister(backupCommandAnnotation, fileExtensionAnnotation, namespace string, log logr.Logger) *PodLister

NewPodLister returns a PodLister configured to find the defined annotations.

func (*PodLister) ListPods

func (p *PodLister) ListPods() ([]BackupPod, error)

ListPods resturns a list of pods which have backup commands in their annotations.

Jump to

Keyboard shortcuts

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