storage

package
v0.0.0-...-73f0a56 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdditionalOptions

type AdditionalOptions func(builder *ClassBuilder) (*ClassBuilder, error)

AdditionalOptions additional options for storageclass object.

type ClassBuilder

type ClassBuilder struct {
	// Storageclass definition. Used to create the storageclass object.
	Definition *storageV1.StorageClass
	// Created storageclass object
	Object *storageV1.StorageClass
	// contains filtered or unexported fields
}

ClassBuilder provides struct for storageclass object containing connection to the cluster and the storageclass definitions.

func NewClassBuilder

func NewClassBuilder(apiClient *clients.Settings, name, provisioner string) *ClassBuilder

NewClassBuilder creates a new instance of ClassBuilder.

func (*ClassBuilder) Create

func (builder *ClassBuilder) Create() (*ClassBuilder, error)

Create generates a storageclass in cluster and stores the created object in struct.

func (*ClassBuilder) Delete

func (builder *ClassBuilder) Delete() error

Delete removes a storageclass.

func (*ClassBuilder) Exists

func (builder *ClassBuilder) Exists() bool

Exists checks whether the given storageclass exists.

func (*ClassBuilder) Update

func (builder *ClassBuilder) Update(force bool) (*ClassBuilder, error)

Update renovates the existing storageclass object with the storageclass definition in builder.

func (*ClassBuilder) WithOptions

func (builder *ClassBuilder) WithOptions(options ...AdditionalOptions) *ClassBuilder

WithOptions creates a storageclass with generic mutation options.

func (*ClassBuilder) WithParameter

func (builder *ClassBuilder) WithParameter(parameterKey, parameterValue string) *ClassBuilder

WithParameter adds a parameter to the storage class definition.

func (*ClassBuilder) WithReclaimPolicy

func (builder *ClassBuilder) WithReclaimPolicy(
	reclaimPolicy corev1.PersistentVolumeReclaimPolicy) *ClassBuilder

WithReclaimPolicy adds a reclaimPolicy to the storageclass definition.

func (*ClassBuilder) WithVolumeBindingMode

func (builder *ClassBuilder) WithVolumeBindingMode(
	bindingMode storageV1.VolumeBindingMode) *ClassBuilder

WithVolumeBindingMode adds a volumeBindingMode to the storage class definition.

type PVBuilder

type PVBuilder struct {
	// PersistentVolume definition. Used to create a persistentvolume object
	Definition *corev1.PersistentVolume
	// Created persistentvolume object
	Object *corev1.PersistentVolume
	// contains filtered or unexported fields
}

PVBuilder provides struct for persistentvolume object containing connection to the cluster and the persistentvolume definitions.

func PullPersistentVolume

func PullPersistentVolume(apiClient *clients.Settings, persistentVolume string) (*PVBuilder, error)

PullPersistentVolume gets an existing PersistentVolume from the cluster.

func (*PVBuilder) Exists

func (builder *PVBuilder) Exists() bool

Exists checks whether the given PersistentVolume exists.

type PVCBuilder

type PVCBuilder struct {
	// PersistentVolumeClaim definition. Used to create a persistentvolumeclaim object
	Definition *corev1.PersistentVolumeClaim
	// Created persistentvolumeclaim object
	Object *corev1.PersistentVolumeClaim
	// contains filtered or unexported fields
}

PVCBuilder provides struct for persistentvolumeclaim object containing connection to the cluster and the persistentvolumeclaim definitions.

func NewPVCBuilder

func NewPVCBuilder(apiClient *clients.Settings, name, nsname string) *PVCBuilder

NewPVCBuilder creates a new structure for persistentvolumeclaim.

func PullPersistentVolumeClaim

func PullPersistentVolumeClaim(
	apiClient *clients.Settings, persistentVolumeClaim string, nsname string) (
	*PVCBuilder, error)

PullPersistentVolumeClaim gets an existing PersistentVolumeClaim from the cluster.

func (*PVCBuilder) Create

func (builder *PVCBuilder) Create() (*PVCBuilder, error)

Create generates a PVC in cluster and stores the created object in struct.

func (*PVCBuilder) Delete

func (builder *PVCBuilder) Delete() error

Delete removes PVC from cluster.

func (*PVCBuilder) DeleteAndWait

func (builder *PVCBuilder) DeleteAndWait(timeout time.Duration) error

DeleteAndWait deletes PersistentVolumeClaim and waits until it is removed from the cluster.

func (*PVCBuilder) Exists

func (builder *PVCBuilder) Exists() bool

Exists checks whether the given PersistentVolumeClaim exists.

func (*PVCBuilder) WithPVCAccessMode

func (builder *PVCBuilder) WithPVCAccessMode(accessMode string) (*PVCBuilder, error)

WithPVCAccessMode configure access mode for the PV.

func (*PVCBuilder) WithPVCCapacity

func (builder *PVCBuilder) WithPVCCapacity(capacity string) (*PVCBuilder, error)

WithPVCCapacity configures the minimum resources the volume should have.

func (*PVCBuilder) WithStorageClass

func (builder *PVCBuilder) WithStorageClass(storageClass string) (*PVCBuilder, error)

WithStorageClass configures storageClass required by the claim.

func (*PVCBuilder) WithVolumeMode

func (builder *PVCBuilder) WithVolumeMode(volumeMode string) (*PVCBuilder, error)

WithVolumeMode configures what type of volume is required by the claim.

Jump to

Keyboard shortcuts

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