connection

package
v1.16.1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 24 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(address string) (*grpc.ClientConn, error)

Connect establishes connection to socket

func GetControllerClient

func GetControllerClient(restConfig *rest.Config, scheme *runtime.Scheme) (ctrlClient.Client, error)

GetControllerClient - Returns a controller client which reads and writes directly to API server

Types

type ConnHandler

type ConnHandler interface {
	Verify(ctx context.Context) error
	GetConnection(clusterID string) (RemoteClusterClient, error)
}

ConnHandler - Interface

type MultiClusterClient

type MultiClusterClient interface {
	GetConnection(clusterID string) (RemoteClusterClient, error)
	GetClusterID() string
}

MultiClusterClient interface of client that manages multiple clusters at once

type PendingState

type PendingState struct {
	MaxPending int
	// contains filtered or unexported fields
}

PendingState type limits the number of pending requests by making sure there are no other requests for the same RG, otherwise a "pending" error is returned. Additionally, no more than maxPending requests are processed at a time without returning an "overload" error.

type RemoteClusterClient

type RemoteClusterClient interface {
	GetStorageClass(ctx context.Context, storageClassName string) (*storageV1.StorageClass, error)
	ListStorageClass(ctx context.Context) (*storageV1.StorageClassList, error)
	CreateStorageClass(ctx context.Context, storageClass *storageV1.StorageClass) error
	ListCustomResourceDefinitions(ctx context.Context) (*apiExtensionsv1.CustomResourceDefinitionList, error)
	GetCustomResourceDefinitions(ctx context.Context, crdName string) (*apiExtensionsv1.CustomResourceDefinition, error)
	GetPersistentVolume(ctx context.Context, persistentVolumeName string) (*corev1.PersistentVolume, error)
	DeletePersistentVolume(ctx context.Context, pv *corev1.PersistentVolume) error
	CreatePersistentVolume(ctx context.Context, volume *corev1.PersistentVolume) error
	UpdatePersistentVolume(ctx context.Context, volume *corev1.PersistentVolume) error
	GetPersistentVolumeClaim(ctx context.Context, namespace, claimName string) (*corev1.PersistentVolumeClaim, error)
	UpdatePersistentVolumeClaim(ctx context.Context, claim *corev1.PersistentVolumeClaim) error
	CreatePersistentVolumeClaim(ctx context.Context, claim *corev1.PersistentVolumeClaim) error
	DeletePersistentVolumeClaim(ctx context.Context, claim *corev1.PersistentVolumeClaim) error
	ListPersistentVolumeClaim(ctx context.Context, opts ...ctrlClient.ListOption) (*corev1.PersistentVolumeClaimList, error)
	GetReplicationGroup(ctx context.Context, replicationGroupName string) (*repv1.DellCSIReplicationGroup, error)
	UpdateReplicationGroup(ctx context.Context, group *repv1.DellCSIReplicationGroup) error
	ListReplicationGroup(ctx context.Context) (*repv1.DellCSIReplicationGroupList, error)
	CreateReplicationGroup(ctx context.Context, group *repv1.DellCSIReplicationGroup) error
	CreateSnapshotContent(ctx context.Context, content *s1.VolumeSnapshotContent) error
	CreateSnapshotObject(ctx context.Context, content *s1.VolumeSnapshot) error
	GetSnapshotClass(ctx context.Context, snapClassName string) (*s1.VolumeSnapshotClass, error)
	CreateNamespace(ctx context.Context, content *corev1.Namespace) error
	GetNamespace(ctx context.Context, namespace string) (*corev1.Namespace, error)
	GetObject(ctx context.Context, key ctrlClient.ObjectKey, obj ctrlClient.Object) error
	UpdateObject(ctx context.Context, obj ctrlClient.Object) error
	DeleteObject(ctx context.Context, obj ctrlClient.Object) error
}

RemoteClusterClient interface provides methods for creating, modifying, deleting objects on a remote k8s cluster

type RemoteK8sConnHandler

type RemoteK8sConnHandler struct {
	// contains filtered or unexported fields
}

RemoteK8sConnHandler handler of remote Kubernetes cluster connection

func (*RemoteK8sConnHandler) AddOrUpdateConfig

func (k8sConnHandler *RemoteK8sConnHandler) AddOrUpdateConfig(clusterID string, config *rest.Config)

AddOrUpdateConfig adds (or updates) config to the list of managed clusters

func (*RemoteK8sConnHandler) GetConnection

func (k8sConnHandler *RemoteK8sConnHandler) GetConnection(clusterID string) (RemoteClusterClient, error)

GetConnection returns client from the map of managed clusters

func (*RemoteK8sConnHandler) Verify

func (k8sConnHandler *RemoteK8sConnHandler) Verify(ctx context.Context) error

Verify if the connections have been established properly and all the required APIs are available on the remote cluster

type RemoteK8sControllerClient

type RemoteK8sControllerClient struct {
	ClusterID string
	Client    ctrlClient.Client
}

RemoteK8sControllerClient - Represents a single controller split client

func (*RemoteK8sControllerClient) CreateNamespace added in v1.4.0

func (c *RemoteK8sControllerClient) CreateNamespace(ctx context.Context, content *corev1.Namespace) error

CreateNamespace creates a desired namespace on the remote cluster.

func (*RemoteK8sControllerClient) CreatePersistentVolume

func (c *RemoteK8sControllerClient) CreatePersistentVolume(ctx context.Context, volume *corev1.PersistentVolume) error

CreatePersistentVolume creates persistent volume object in current cluster

func (*RemoteK8sControllerClient) CreatePersistentVolumeClaim added in v1.12.0

func (c *RemoteK8sControllerClient) CreatePersistentVolumeClaim(ctx context.Context, claim *corev1.PersistentVolumeClaim) error

CreatePersistentVolumeClaim returns persistent volume claim object in current cluster

func (*RemoteK8sControllerClient) CreateReplicationGroup

func (c *RemoteK8sControllerClient) CreateReplicationGroup(ctx context.Context, group *repv1.DellCSIReplicationGroup) error

CreateReplicationGroup creates replication group object in current cluster

func (*RemoteK8sControllerClient) CreateSnapshotContent added in v1.4.0

func (c *RemoteK8sControllerClient) CreateSnapshotContent(ctx context.Context, content *s1.VolumeSnapshotContent) error

CreateSnapshotContent creates the snapshot content on the remote cluster

func (*RemoteK8sControllerClient) CreateSnapshotObject added in v1.4.0

func (c *RemoteK8sControllerClient) CreateSnapshotObject(ctx context.Context, content *s1.VolumeSnapshot) error

CreateSnapshotObject creates the snapshot on the remote cluster

func (*RemoteK8sControllerClient) CreateStorageClass

func (c *RemoteK8sControllerClient) CreateStorageClass(ctx context.Context, storageClass *storageV1.StorageClass) error

CreateStorageClass creates storage class object in current cluster

func (*RemoteK8sControllerClient) DeleteObject added in v1.15.0

func (c *RemoteK8sControllerClient) DeleteObject(ctx context.Context, obj ctrlClient.Object) error

DeleteObject deletes a generic Kubernetes object (including unstructured CRDs) from the cluster.

func (*RemoteK8sControllerClient) DeletePersistentVolume added in v1.14.0

func (c *RemoteK8sControllerClient) DeletePersistentVolume(ctx context.Context, pv *corev1.PersistentVolume) error

DeletePersistentVolume deletes the persistent volume object in current cluster

func (*RemoteK8sControllerClient) DeletePersistentVolumeClaim added in v1.12.0

func (c *RemoteK8sControllerClient) DeletePersistentVolumeClaim(ctx context.Context, claim *corev1.PersistentVolumeClaim) error

DeletePersistentVolumeClaim deletes the persistent volume claim object in current cluster

func (*RemoteK8sControllerClient) GetCustomResourceDefinitions

func (c *RemoteK8sControllerClient) GetCustomResourceDefinitions(ctx context.Context, crdName string) (*apiExtensionsv1.CustomResourceDefinition, error)

GetCustomResourceDefinitions returns custom resource definition object by querying cluster using custom resource definition name

func (*RemoteK8sControllerClient) GetNamespace added in v1.4.0

func (c *RemoteK8sControllerClient) GetNamespace(ctx context.Context, namespace string) (*corev1.Namespace, error)

GetNamespace returns the desired namespace from the remote cluster.

func (*RemoteK8sControllerClient) GetObject added in v1.15.0

GetObject fetches a generic Kubernetes object (including unstructured CRDs) from the cluster.

func (*RemoteK8sControllerClient) GetPersistentVolume

func (c *RemoteK8sControllerClient) GetPersistentVolume(ctx context.Context, persistentVolumeName string) (*corev1.PersistentVolume, error)

GetPersistentVolume returns persistent volume object by querying cluster using persistent volume name

func (*RemoteK8sControllerClient) GetPersistentVolumeClaim

func (c *RemoteK8sControllerClient) GetPersistentVolumeClaim(ctx context.Context, namespace, claimName string) (*corev1.PersistentVolumeClaim, error)

GetPersistentVolumeClaim returns persistent volume claim object by querying cluster using persistent volume claim name

func (*RemoteK8sControllerClient) GetReplicationGroup

func (c *RemoteK8sControllerClient) GetReplicationGroup(ctx context.Context, replicationGroupName string) (*repv1.DellCSIReplicationGroup, error)

GetReplicationGroup returns replication group object by querying cluster using replication group name

func (*RemoteK8sControllerClient) GetSnapshotClass added in v1.4.0

func (c *RemoteK8sControllerClient) GetSnapshotClass(ctx context.Context, snapClassName string) (*s1.VolumeSnapshotClass, error)

GetSnapshotClass returns snapshot class object by querying cluster using snapshot class name.

func (*RemoteK8sControllerClient) GetStorageClass

func (c *RemoteK8sControllerClient) GetStorageClass(ctx context.Context, storageClassName string) (*storageV1.StorageClass, error)

GetStorageClass returns storage class object by querying cluster using storage class name

func (*RemoteK8sControllerClient) ListCustomResourceDefinitions

ListCustomResourceDefinitions returns list of custom resource definition objects that are currently in cluster

func (*RemoteK8sControllerClient) ListPersistentVolumeClaim added in v1.12.0

ListPersistentVolumeClaim gets the list of persistent volume claim objects under the replication group

func (*RemoteK8sControllerClient) ListReplicationGroup

ListReplicationGroup returns list of all replication group objects that are currently in cluster

func (*RemoteK8sControllerClient) ListStorageClass

ListStorageClass returns list of all storage classes objects that are currently in cluster

func (*RemoteK8sControllerClient) UpdateObject added in v1.15.0

func (c *RemoteK8sControllerClient) UpdateObject(ctx context.Context, obj ctrlClient.Object) error

UpdateObject updates a generic Kubernetes object (including unstructured CRDs) on the cluster.

func (*RemoteK8sControllerClient) UpdatePersistentVolume

func (c *RemoteK8sControllerClient) UpdatePersistentVolume(ctx context.Context, volume *corev1.PersistentVolume) error

UpdatePersistentVolume updates persistent volume object in current cluster

func (*RemoteK8sControllerClient) UpdatePersistentVolumeClaim

func (c *RemoteK8sControllerClient) UpdatePersistentVolumeClaim(ctx context.Context, claim *corev1.PersistentVolumeClaim) error

UpdatePersistentVolumeClaim updates persistent volume claim object in current cluster

func (*RemoteK8sControllerClient) UpdateReplicationGroup

func (c *RemoteK8sControllerClient) UpdateReplicationGroup(ctx context.Context, replicationGroup *repv1.DellCSIReplicationGroup) error

UpdateReplicationGroup updates replication group object in current cluster

type RgIDType

type RgIDType string

RgIDType represents replication group id

func (RgIDType) CheckAndUpdatePendingState

func (rgID RgIDType) CheckAndUpdatePendingState(ps *PendingState) error

CheckAndUpdatePendingState sets state of current RG as pending if allowed by current capacity

func (RgIDType) ClearPending

func (rgID RgIDType) ClearPending(ps *PendingState)

ClearPending removes current replication group from pending list

Jump to

Keyboard shortcuts

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