pv

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// KubeClient *core.KubeClient
	Interface tcorev1.PersistentVolumeInterface
	Timeout   int
}

Client contains pvc interface and kubeclient

func (*Client) CheckReplicationAnnotationsForPV

func (c *Client) CheckReplicationAnnotationsForPV(ctx context.Context, object *v1.PersistentVolume) error

CheckReplicationAnnotationsForPV checks for replication related annotations and labels on PV

func (*Client) CheckReplicationAnnotationsForRemotePV

func (c *Client) CheckReplicationAnnotationsForRemotePV(ctx context.Context, object *v1.PersistentVolume) error

CheckReplicationAnnotationsForRemotePV checks for replication related annotations and labels for remote PV

func (*Client) Delete

Delete deletes PersistentVolumeClaim from Kubernetes

func (*Client) DeleteAll

func (c *Client) DeleteAll(ctx context.Context) error

DeleteAll deletes all client pvs in timely manner

func (*Client) DeleteAllPV

func (c *Client) DeleteAllPV(ctx context.Context, ns string, vaClient *va.Client) error

DeleteAllPV deletes all pvs in timely manner on the basis of namespace

func (*Client) Get

func (c *Client) Get(ctx context.Context, name string) *PersistentVolume

Get uses client interface to make API call for getting provided PersistentVolume

func (*Client) Update

Update updates a PersistentVolume

func (*Client) WaitPV

func (c *Client) WaitPV(ctx context.Context, newPVName string) error

WaitPV waits when pv will be available

type PersistentVolume

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

PersistentVolume conatins pv client and claim

func (*PersistentVolume) GetError

func (pv *PersistentVolume) GetError() error

GetError returns PV error

func (*PersistentVolume) HasError

func (pv *PersistentVolume) HasError() bool

HasError checks if PV contains error

func (*PersistentVolume) Sync

Sync waits until PV is deleted or bound

func (*PersistentVolume) WaitToBeBound

func (pv *PersistentVolume) WaitToBeBound(ctx context.Context) error

WaitToBeBound waits for PVC to be in Bound state

func (*PersistentVolume) WaitUntilGone

func (pv *PersistentVolume) WaitUntilGone(ctx context.Context) error

WaitUntilGone stalls until said Pod no longer can be found in Kubernetes

Jump to

Keyboard shortcuts

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