gcp

package
v0.0.0-...-58f6e79 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2025 License: Apache-2.0 Imports: 32 Imported by: 11

Documentation

Index

Constants

View Source
const (
	MinimumVolumeSizeBytes = uint64(1073741824) // 1 GiB

	Size            = "size"
	ServiceLevel    = "serviceLevel"
	SnapshotDir     = "snapshotDir"
	SnapshotReserve = "snapshotReserve"
	ExportRule      = "exportRule"
	Network         = "network"
	Region          = "region"
	Zone            = "zone"
	StorageClass    = "storageClass"
	UnixPermissions = "unixPermissions"
	StoragePools    = "storagePools"
)
View Source
const (
	MinimumCVSVolumeSizeBytesHW  = uint64(107374182400) // 100 GiB
	MaximumVolumesPerStoragePool = 50
	MinimumAPIVersion            = "1.4.0"
	MinimumSDEVersion            = "2023.1.2"
)
View Source
const (
	MinimumGCNVVolumeSizeBytesSW = uint64(1073741824)   // 1 GiB
	MinimumGCNVVolumeSizeBytesHW = uint64(107374182400) // 100 GiB

	CapacityPools = "capacityPools"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NASStorageDriver

type NASStorageDriver struct {
	Config drivers.GCNVNASStorageDriverConfig
	API    gcnvapi.GCNV
	// contains filtered or unexported fields
}

NASStorageDriver is for storage provisioning using the Google Cloud NetApp Volumes service.

func (*NASStorageDriver) BackendName

func (d *NASStorageDriver) BackendName() string

BackendName returns the name of the backend managed by this driver instance.

func (*NASStorageDriver) CanSnapshot

CanSnapshot determines whether a snapshot as specified in the provided snapshot config may be taken.

func (*NASStorageDriver) Create

func (d *NASStorageDriver) Create(
	ctx context.Context, volConfig *storage.VolumeConfig, storagePool storage.Pool, volAttributes map[string]sa.Request,
) error

Create creates a new volume.

func (*NASStorageDriver) CreateClone

func (d *NASStorageDriver) CreateClone(
	ctx context.Context, sourceVolConfig, cloneVolConfig *storage.VolumeConfig, storagePool storage.Pool,
) error

CreateClone clones an existing volume. If a snapshot is not specified, one is created.

func (*NASStorageDriver) CreateFollowup

func (d *NASStorageDriver) CreateFollowup(ctx context.Context, volConfig *storage.VolumeConfig) error

CreateFollowup is called after volume creation and sets the access info in the volume config.

func (*NASStorageDriver) CreatePrepare

func (d *NASStorageDriver) CreatePrepare(ctx context.Context, volConfig *storage.VolumeConfig, pool storage.Pool)

CreatePrepare is called prior to volume creation. Currently its only role is to create the internal volume name.

func (*NASStorageDriver) CreateSnapshot

func (d *NASStorageDriver) CreateSnapshot(
	ctx context.Context, snapConfig *storage.SnapshotConfig, volConfig *storage.VolumeConfig,
) (*storage.Snapshot, error)

CreateSnapshot creates a snapshot for the given volume.

func (*NASStorageDriver) DeleteSnapshot

func (d *NASStorageDriver) DeleteSnapshot(
	ctx context.Context, snapConfig *storage.SnapshotConfig, volConfig *storage.VolumeConfig,
) error

DeleteSnapshot deletes a snapshot of a volume.

func (*NASStorageDriver) Destroy

func (d *NASStorageDriver) Destroy(ctx context.Context, volConfig *storage.VolumeConfig) (err error)

Destroy deletes a volume.

func (*NASStorageDriver) Get

func (d *NASStorageDriver) Get(ctx context.Context, name string) error

Get tests for the existence of a volume.

func (*NASStorageDriver) GetCommonConfig

GetCommonConfig returns driver's CommonConfig

func (*NASStorageDriver) GetConfig

func (d *NASStorageDriver) GetConfig() drivers.DriverConfig

GetConfig returns the config of this driver.

func (*NASStorageDriver) GetExternalConfig

func (d *NASStorageDriver) GetExternalConfig(ctx context.Context) interface{}

GetExternalConfig returns a clone of this backend's config, sanitized for external consumption.

func (*NASStorageDriver) GetInternalVolumeName

func (d *NASStorageDriver) GetInternalVolumeName(
	ctx context.Context, volConfig *storage.VolumeConfig, pool storage.Pool,
) string

GetInternalVolumeName accepts the name of a volume being created and returns what the internal name should be, depending on backend requirements and Trident's operating context.

func (*NASStorageDriver) GetProtocol

GetProtocol returns the protocol supported by this driver (File).

func (*NASStorageDriver) GetSnapshot

func (d *NASStorageDriver) GetSnapshot(
	ctx context.Context, snapConfig *storage.SnapshotConfig, volConfig *storage.VolumeConfig,
) (*storage.Snapshot, error)

GetSnapshot returns a snapshot of a volume, or an error if it does not exist.

func (*NASStorageDriver) GetSnapshots

func (d *NASStorageDriver) GetSnapshots(
	ctx context.Context, volConfig *storage.VolumeConfig,
) ([]*storage.Snapshot, error)

GetSnapshots returns the list of snapshots associated with the specified volume.

func (*NASStorageDriver) GetStorageBackendPhysicalPoolNames

func (d *NASStorageDriver) GetStorageBackendPhysicalPoolNames(context.Context) []string

GetStorageBackendPhysicalPoolNames retrieves storage backend physical pools

func (*NASStorageDriver) GetStorageBackendSpecs

func (d *NASStorageDriver) GetStorageBackendSpecs(_ context.Context, backend storage.Backend) error

GetStorageBackendSpecs retrieves storage capabilities and register pools with specified backend.

func (*NASStorageDriver) GetUpdateType

func (d *NASStorageDriver) GetUpdateType(_ context.Context, driverOrig storage.Driver) *roaring.Bitmap

GetUpdateType returns a bitmap populated with updates to the driver.

func (*NASStorageDriver) GetVolumeExternalWrappers

func (d *NASStorageDriver) GetVolumeExternalWrappers(ctx context.Context, channel chan *storage.VolumeExternalWrapper)

GetVolumeExternalWrappers queries the storage backend for all relevant info about container volumes managed by this driver. It then writes a VolumeExternal representation of each volume to the supplied channel, closing the channel when finished.

func (*NASStorageDriver) GetVolumeForImport

func (d *NASStorageDriver) GetVolumeForImport(ctx context.Context, volumeID string) (*storage.VolumeExternal, error)

GetVolumeForImport queries the storage backend for all relevant info about a single container volume managed by this driver and returns a VolumeExternal representation of the volume. For this driver, volumeID is the name used when creating the volume.

func (*NASStorageDriver) GoString

func (d *NASStorageDriver) GoString() string

GoString implements GoStringer interface for the NASStorageDriver driver.

func (*NASStorageDriver) Import

func (d *NASStorageDriver) Import(ctx context.Context, volConfig *storage.VolumeConfig, originalName string) error

Import finds an existing volume and makes it available for containers. If ImportNotManaged is false, the volume is fully brought under Trident's management.

func (*NASStorageDriver) Initialize

func (d *NASStorageDriver) Initialize(
	ctx context.Context, context tridentconfig.DriverContext, configJSON string,
	commonConfig *drivers.CommonStorageDriverConfig, backendSecret map[string]string, backendUUID string,
) error

Initialize initializes this driver from the provided config.

func (*NASStorageDriver) Initialized

func (d *NASStorageDriver) Initialized() bool

Initialized returns whether this driver has been initialized (and not terminated).

func (*NASStorageDriver) List

func (d *NASStorageDriver) List(ctx context.Context) ([]string, error)

List returns the list of volumes associated with this backend.

func (*NASStorageDriver) Name

func (d *NASStorageDriver) Name() string

Name returns the name of this driver.

func (*NASStorageDriver) Publish

func (d *NASStorageDriver) Publish(
	ctx context.Context, volConfig *storage.VolumeConfig, publishInfo *models.VolumePublishInfo,
) error

Publish the volume to the host specified in publishInfo. This method may or may not be running on the host where the volume will be mounted, so it should limit itself to updating access rules, initiator groups, etc. that require some host identity (but not locality) as well as storage controller API access.

func (*NASStorageDriver) ReconcileNodeAccess

func (d *NASStorageDriver) ReconcileNodeAccess(
	ctx context.Context, _ []*models.Node, _, _ string,
) error

ReconcileNodeAccess updates a per-backend export policy to match the set of Kubernetes cluster nodes. Not supported by this driver.

func (*NASStorageDriver) ReconcileVolumeNodeAccess

func (d *NASStorageDriver) ReconcileVolumeNodeAccess(ctx context.Context, _ *storage.VolumeConfig, _ []*models.Node) error

func (*NASStorageDriver) Rename

func (d *NASStorageDriver) Rename(ctx context.Context, name, newName string) error

Rename changes the name of a volume. Not supported by this driver.

func (*NASStorageDriver) Resize

func (d *NASStorageDriver) Resize(ctx context.Context, volConfig *storage.VolumeConfig, sizeBytes uint64) error

Resize increases a volume's quota.

func (*NASStorageDriver) RestoreSnapshot

func (d *NASStorageDriver) RestoreSnapshot(
	ctx context.Context, snapConfig *storage.SnapshotConfig, volConfig *storage.VolumeConfig,
) error

RestoreSnapshot restores a volume (in place) from a snapshot.

func (*NASStorageDriver) StoreConfig

StoreConfig adds this backend's config to the persistent config struct, as needed by Trident's persistence layer.

func (*NASStorageDriver) String

func (d *NASStorageDriver) String() string

String implements stringer interface for the NASStorageDriver driver.

func (*NASStorageDriver) Terminate

func (d *NASStorageDriver) Terminate(ctx context.Context, _ string)

Terminate stops the driver prior to its being unloaded.

type NFSStorageDriver

type NFSStorageDriver struct {
	Config drivers.GCPNFSStorageDriverConfig
	API    api.GCPClient
	// contains filtered or unexported fields
}

NFSStorageDriver is for storage provisioning using Cloud Volumes Service in GCP

func (*NFSStorageDriver) BackendName

func (d *NFSStorageDriver) BackendName() string

BackendName returns the name of the backend managed by this driver instance

func (*NFSStorageDriver) CanSnapshot

CanSnapshot determines whether a snapshot as specified in the provided snapshot config may be taken.

func (*NFSStorageDriver) Create

func (d *NFSStorageDriver) Create(
	ctx context.Context, volConfig *storage.VolumeConfig, storagePool storage.Pool, volAttributes map[string]sa.Request,
) error

Create a volume with the specified options

func (*NFSStorageDriver) CreateClone

func (d *NFSStorageDriver) CreateClone(
	ctx context.Context, sourceVolConfig, cloneVolConfig *storage.VolumeConfig, storagePool storage.Pool,
) error

CreateClone clones an existing volume. If a snapshot is not specified, one is created.

func (*NFSStorageDriver) CreateFollowup

func (d *NFSStorageDriver) CreateFollowup(ctx context.Context, volConfig *storage.VolumeConfig) error

func (*NFSStorageDriver) CreateGCPInternalID

func (d *NFSStorageDriver) CreateGCPInternalID(vol *api.Volume) string

func (*NFSStorageDriver) CreatePrepare

func (d *NFSStorageDriver) CreatePrepare(ctx context.Context, volConfig *storage.VolumeConfig, pool storage.Pool)

func (*NFSStorageDriver) CreateSnapshot

func (d *NFSStorageDriver) CreateSnapshot(
	ctx context.Context, snapConfig *storage.SnapshotConfig, _ *storage.VolumeConfig,
) (*storage.Snapshot, error)

CreateSnapshot creates a snapshot for the given volume.

func (*NFSStorageDriver) DeleteSnapshot

func (d *NFSStorageDriver) DeleteSnapshot(
	ctx context.Context, snapConfig *storage.SnapshotConfig, _ *storage.VolumeConfig,
) error

DeleteSnapshot creates a snapshot of a volume.

func (*NFSStorageDriver) Destroy

func (d *NFSStorageDriver) Destroy(ctx context.Context, volConfig *storage.VolumeConfig) error

Destroy deletes a volume.

func (*NFSStorageDriver) Get

func (d *NFSStorageDriver) Get(ctx context.Context, name string) error

Get tests for the existence of a volume

func (*NFSStorageDriver) GetAPI

func (d *NFSStorageDriver) GetAPI() api.GCPClient

func (NFSStorageDriver) GetCommonConfig

GetCommonConfig returns driver's CommonConfig

func (*NFSStorageDriver) GetConfig

func (d *NFSStorageDriver) GetConfig() drivers.DriverConfig

func (*NFSStorageDriver) GetExternalConfig

func (d *NFSStorageDriver) GetExternalConfig(ctx context.Context) interface{}

func (*NFSStorageDriver) GetGCPPoolsForStoragePool

func (d *NFSStorageDriver) GetGCPPoolsForStoragePool(
	ctx context.Context, sPool storage.Pool, poolServiceLevel string, volSizeBytes int64,
) ([]*api.Pool, string, error)

GetGCPPoolsForStoragePool returns all discovered GCP pools matching the specified storage pool and service level.

func (*NFSStorageDriver) GetInternalVolumeName

func (d *NFSStorageDriver) GetInternalVolumeName(
	ctx context.Context, volConfig *storage.VolumeConfig, _ storage.Pool,
) string

func (*NFSStorageDriver) GetPoolsForCreate

func (d *NFSStorageDriver) GetPoolsForCreate(
	ctx context.Context, sPool storage.Pool, poolServiceLevel string, volSizeBytes int64,
) ([]*api.Pool, error)

GetPoolsForCreate is called by software storage class backends only. We return an array of storage pools. If no pools are found, we return error.

func (*NFSStorageDriver) GetProtocol

func (*NFSStorageDriver) GetSnapshot

func (d *NFSStorageDriver) GetSnapshot(
	ctx context.Context, snapConfig *storage.SnapshotConfig, _ *storage.VolumeConfig,
) (*storage.Snapshot, error)

GetSnapshot gets a snapshot. To distinguish between an API error reading the snapshot and a non-existent snapshot, this method may return (nil, nil).

func (*NFSStorageDriver) GetSnapshots

func (d *NFSStorageDriver) GetSnapshots(
	ctx context.Context, volConfig *storage.VolumeConfig,
) ([]*storage.Snapshot, error)

GetSnapshots returns the list of snapshots associated with the specified volume

func (*NFSStorageDriver) GetStorageBackendPhysicalPoolNames

func (d *NFSStorageDriver) GetStorageBackendPhysicalPoolNames(context.Context) []string

GetStorageBackendPhysicalPoolNames retrieves storage backend physical pools

func (*NFSStorageDriver) GetStorageBackendSpecs

func (d *NFSStorageDriver) GetStorageBackendSpecs(_ context.Context, backend storage.Backend) error

GetStorageBackendSpecs retrieves storage capabilities and register pools with specified backend.

func (*NFSStorageDriver) GetUpdateType

func (d *NFSStorageDriver) GetUpdateType(_ context.Context, driverOrig storage.Driver) *roaring.Bitmap

GetUpdateType returns a bitmap populated with updates to the driver

func (*NFSStorageDriver) GetVolumeExternalWrappers

func (d *NFSStorageDriver) GetVolumeExternalWrappers(ctx context.Context, channel chan *storage.VolumeExternalWrapper)

GetVolumeExternalWrappers queries the storage backend for all relevant info about container volumes managed by this driver. It then writes a VolumeExternal representation of each volume to the supplied channel, closing the channel when finished.

func (*NFSStorageDriver) GetVolumeForImport

func (d *NFSStorageDriver) GetVolumeForImport(ctx context.Context, volumeID string) (*storage.VolumeExternal, error)

GetVolumeForImport queries the storage backend for all relevant info about a single container volume managed by this driver and returns a VolumeExternal representation of the volume. For this driver, volumeID is the unique creation token used when creating the volume.

func (NFSStorageDriver) GoString

func (d NFSStorageDriver) GoString() string

GoString implements GoStringer interface for the NFSStorageDriver driver

func (*NFSStorageDriver) Import

func (d *NFSStorageDriver) Import(ctx context.Context, volConfig *storage.VolumeConfig, originalName string) error

func (*NFSStorageDriver) Initialize

func (d *NFSStorageDriver) Initialize(
	ctx context.Context, context tridentconfig.DriverContext, configJSON string,
	commonConfig *drivers.CommonStorageDriverConfig, backendSecret map[string]string, backendUUID string,
) error

Initialize initializes this driver from the provided config

func (*NFSStorageDriver) Initialized

func (d *NFSStorageDriver) Initialized() bool

Initialized returns whether this driver has been initialized (and not terminated)

func (*NFSStorageDriver) List

func (d *NFSStorageDriver) List(ctx context.Context) ([]string, error)

List returns the list of volumes associated with this tenant

func (*NFSStorageDriver) Name

func (d *NFSStorageDriver) Name() string

Name returns the name of this driver

func (*NFSStorageDriver) Publish

func (d *NFSStorageDriver) Publish(
	ctx context.Context, volConfig *storage.VolumeConfig, publishInfo *models.VolumePublishInfo,
) error

Publish the volume to the host specified in publishInfo. This method may or may not be running on the host where the volume will be mounted, so it should limit itself to updating access rules, initiator groups, etc. that require some host identity (but not locality) as well as storage controller API access.

func (*NFSStorageDriver) ReconcileNodeAccess

func (d *NFSStorageDriver) ReconcileNodeAccess(
	ctx context.Context, nodes []*models.Node, _, _ string,
) error

func (*NFSStorageDriver) ReconcileVolumeNodeAccess

func (d *NFSStorageDriver) ReconcileVolumeNodeAccess(ctx context.Context, _ *storage.VolumeConfig, _ []*models.Node) error

func (*NFSStorageDriver) Rename

func (d *NFSStorageDriver) Rename(ctx context.Context, name, newName string) error

func (*NFSStorageDriver) Resize

func (d *NFSStorageDriver) Resize(ctx context.Context, volConfig *storage.VolumeConfig, sizeBytes uint64) error

Resize increases a volume's quota

func (*NFSStorageDriver) RestoreSnapshot

func (d *NFSStorageDriver) RestoreSnapshot(
	ctx context.Context, snapConfig *storage.SnapshotConfig, _ *storage.VolumeConfig,
) error

RestoreSnapshot restores a volume (in place) from a snapshot.

func (*NFSStorageDriver) StoreConfig

func (NFSStorageDriver) String

func (d NFSStorageDriver) String() string

String implements stringer interface for the NFSStorageDriver driver

func (*NFSStorageDriver) Terminate

func (d *NFSStorageDriver) Terminate(ctx context.Context, _ string)

Terminate stops the driver prior to its being unloaded

type Telemetry

type Telemetry struct {
	tridentconfig.Telemetry
	Plugin string `json:"plugin"`
}

Directories

Path Synopsis
This package provides a high-level interface to the NetApp GCP Cloud Volumes NFS REST API.
This package provides a high-level interface to the NetApp GCP Cloud Volumes NFS REST API.
Package gcnvapi provides a high-level interface to the Google Cloud NetApp Volumes SDK
Package gcnvapi provides a high-level interface to the Google Cloud NetApp Volumes SDK

Jump to

Keyboard shortcuts

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