Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) CheckAnnotationsForVolumes(ctx context.Context, scObject *v2.StorageClass) error
- func (c *Client) Create(ctx context.Context, pvc *v1.PersistentVolumeClaim, _ ...int) *PersistentVolumeClaim
- func (c *Client) CreateMultiple(ctx context.Context, pvc *v1.PersistentVolumeClaim, pvcNum int, pvcSize string) error
- func (c *Client) CreatePVCObject(_ context.Context, remotePVObject *v1.PersistentVolume, remoteNamespace string) v1.PersistentVolumeClaim
- func (c *Client) Delete(ctx context.Context, pvc *v1.PersistentVolumeClaim) *PersistentVolumeClaim
- func (c *Client) DeleteAll(ctx context.Context) error
- func (c *Client) Get(ctx context.Context, name string) *PersistentVolumeClaim
- func (c *Client) MakePVC(cfg *Config) *v1.PersistentVolumeClaim
- func (c *Client) MakePVCFromYaml(ctx context.Context, filePath string) (*v1.PersistentVolumeClaim, error)
- func (c *Client) Update(ctx context.Context, pvc *v1.PersistentVolumeClaim) *PersistentVolumeClaim
- func (c *Client) WaitForAllToBeBound(ctx context.Context) error
- type Config
- type PersistentVolumeClaim
- func (pvc *PersistentVolumeClaim) GetError() error
- func (pvc *PersistentVolumeClaim) HasError() bool
- func (pvc *PersistentVolumeClaim) Sync(ctx context.Context) *PersistentVolumeClaim
- func (pvc *PersistentVolumeClaim) WaitToBeBound(ctx context.Context) error
- func (pvc *PersistentVolumeClaim) WaitUntilGone(ctx context.Context) error
Constants ¶
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 // Block volume mode Block = "Block" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // KubeClient *core.KubeClient Interface tcorev1.PersistentVolumeClaimInterface ClientSet kubernetes.Interface Namespace string Timeout int }
Client conatins pvc interface and kubeclient
func (*Client) CheckAnnotationsForVolumes ¶
CheckAnnotationsForVolumes checking annotations for every pvc, that belongs to PVCClient, to be Bound
func (*Client) Create ¶
func (c *Client) Create(ctx context.Context, pvc *v1.PersistentVolumeClaim, _ ...int) *PersistentVolumeClaim
Create uses client interface to make API call for creating provided PersistentVolumeClaim
func (*Client) CreateMultiple ¶
func (c *Client) CreateMultiple(ctx context.Context, pvc *v1.PersistentVolumeClaim, pvcNum int, pvcSize string) error
CreateMultiple creates multiple instances of provided PersistentVolumeClaim
func (*Client) CreatePVCObject ¶
func (c *Client) CreatePVCObject(_ context.Context, remotePVObject *v1.PersistentVolume, remoteNamespace string) v1.PersistentVolumeClaim
CreatePVCObject will read the remotepvobject and return pvc object for the same
func (*Client) Delete ¶
func (c *Client) Delete(ctx context.Context, pvc *v1.PersistentVolumeClaim) *PersistentVolumeClaim
Delete deletes PersistentVolumeClaim from Kubernetes
func (*Client) DeleteAll ¶
DeleteAll deletes all client pvcs in timely manner, using event subscription model
func (*Client) Get ¶
func (c *Client) Get(ctx context.Context, name string) *PersistentVolumeClaim
Get uses client interface to make API call for getting provided PersistentVolumeClaim
func (*Client) MakePVC ¶
func (c *Client) MakePVC(cfg *Config) *v1.PersistentVolumeClaim
MakePVC creates new PersistentVolumeClaim object from Config
func (*Client) MakePVCFromYaml ¶
func (c *Client) MakePVCFromYaml(ctx context.Context, filePath string) (*v1.PersistentVolumeClaim, error)
MakePVCFromYaml makes PersistentVolumeClaim object from provided yaml file
func (*Client) Update ¶
func (c *Client) Update(ctx context.Context, pvc *v1.PersistentVolumeClaim) *PersistentVolumeClaim
Update updates a PersistentVolumeClaim
type Config ¶
type Config struct { // Name defaults to "" if unspecified Name string // NamePrefix defaults to "pvc-" if unspecified NamePrefix string // SnapName SnapName string // SourceVolumeName SourceVolumeName string // ClaimSize must be specified in the Quantity format. Defaults to 2Gi if // unspecified ClaimSize string // AccessModes defaults to RWO if unspecified AccessModes []v1.PersistentVolumeAccessMode Annotations map[string]string Selector *metav1.LabelSelector StorageClassName *string // VolumeMode defaults to nil if unspecified or specified as the empty // string VolumeMode *v1.PersistentVolumeMode // Labels to group the volumes for vgs Labels map[string]string }
Config describes PersistentVolumeClaim
type PersistentVolumeClaim ¶
type PersistentVolumeClaim struct { Client *Client Object *v1.PersistentVolumeClaim Deleted bool // contains filtered or unexported fields }
PersistentVolumeClaim conatins pvc client and claim
func (*PersistentVolumeClaim) GetError ¶
func (pvc *PersistentVolumeClaim) GetError() error
GetError returns PVC error
func (*PersistentVolumeClaim) HasError ¶
func (pvc *PersistentVolumeClaim) HasError() bool
HasError checks if PVC contains error
func (*PersistentVolumeClaim) Sync ¶
func (pvc *PersistentVolumeClaim) Sync(ctx context.Context) *PersistentVolumeClaim
Sync waits until PVC is deleted or bound
func (*PersistentVolumeClaim) WaitToBeBound ¶
func (pvc *PersistentVolumeClaim) WaitToBeBound(ctx context.Context) error
WaitToBeBound waits until PVC is Bound
func (*PersistentVolumeClaim) WaitUntilGone ¶
func (pvc *PersistentVolumeClaim) WaitUntilGone(ctx context.Context) error
WaitUntilGone stalls until said PVC no longer can be found in Kubernetes