kubernetes

package
v2.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTypedClient added in v2.7.0

func NewTypedClient() (client.Client, error)

func SyncSnapshotList added in v2.7.0

func SyncSnapshotList(ctx context.Context, list []dto.Snapshot, namespace, repository string) error

SyncSnapshotList will take a k8upv1.SnapshotList and apply them to the k8s cluster. It will remove any snapshots on the cluster that are not present in the list.

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(ctx context.Context, k8cli client.Client, backupCommandAnnotation, fileExtensionAnnotation, backupContainerAnnotation, namespace string, targetPods []string, skipPreBackup bool, log logr.Logger) *PodLister

NewPodLister returns a PodLister configured to find the defined annotations.

func (*PodLister) ListPods

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

ListPods finds 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