v1

package
v1.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// Poll is a poll interval for Pod
	Poll = 2 * time.Second
	// Timeout is a timeout for Pod operations
	Timeout = 300 * time.Second
)

Variables

This section is empty.

Functions

func IsSnapReady

func IsSnapReady(sn *v1.VolumeSnapshot) bool

IsSnapReady checks whether snapshot is in ReadyToUse state

Types

type Snapshot

type Snapshot struct {
	Client  *SnapshotClient
	Object  *v1.VolumeSnapshot
	Deleted bool
	// contains filtered or unexported fields
}

Snapshot contains parameters needed for managing volume snapshot

func (*Snapshot) GetError

func (snap *Snapshot) GetError() error

GetError returns snapshot error

func (*Snapshot) HasError

func (snap *Snapshot) HasError() bool

HasError checks whether Snapshot has error

func (*Snapshot) Name

func (snap *Snapshot) Name() string

Name returns snapshot name

func (*Snapshot) Sync

func (snap *Snapshot) Sync(ctx context.Context) *Snapshot

Sync updates snapshot state

func (*Snapshot) WaitForRunning

func (snap *Snapshot) WaitForRunning(ctx context.Context) error

WaitForRunning stalls until snapshot is ready

func (*Snapshot) WaitUntilGone

func (snap *Snapshot) WaitUntilGone(ctx context.Context) error

WaitUntilGone waits until snapshot is deleted

type SnapshotClient

type SnapshotClient struct {
	Interface snapshotv1.VolumeSnapshotInterface
	Namespace string
	Timeout   int
}

SnapshotClient is a client for managing Snapshots

func (*SnapshotClient) Create

func (sc *SnapshotClient) Create(ctx context.Context, snap *v1.VolumeSnapshot) *Snapshot

Create creates a snapshot

func (*SnapshotClient) Delete

func (sc *SnapshotClient) Delete(ctx context.Context, snap *v1.VolumeSnapshot) *Snapshot

Delete deletes a snapshot

func (*SnapshotClient) DeleteAll

func (sc *SnapshotClient) DeleteAll(ctx context.Context) error

DeleteAll deletes all snapshots

func (*SnapshotClient) WaitForAllToBeReady

func (sc *SnapshotClient) WaitForAllToBeReady(ctx context.Context) error

WaitForAllToBeReady waits until all snapshots are in ReadyToUse state

Jump to

Keyboard shortcuts

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