service

package
v0.0.0-...-92e8fe8 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Copyright 2022 Infinidat Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2023 Infinidat Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2022 Infinidat Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2022 Infinidat Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 Infinidat Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	ProtocolSecretISCSINetworkSpace    = "iscsi.network_space"
	ProtocolSecretISCSIUseCHAP         = "iscsi.useCHAP"
	ProtocolSecretNVMENetworkSpace     = "nvme.network_space"
	ProtocolSecretNFSNetworkSpace      = "nfs.network_space"
	ProtocolSecretNFSExportPermissions = "nfs.nfs_export_permissions"
)
View Source
const UNKNOWN = "unknown"

Variables

This section is empty.

Functions

func DetermineProtocol

func DetermineProtocol(ctx context.Context) (protocol string, protocolSecret map[string]string, err error)

determine on this node the protocol based on node configuration, this is used when the user specifies a protocol service and sets the protocol to 'auto' 'auto' is used to pick at runtime the block storage that we might support that being (fc, iscsi, or nvme) auto is not for nfs or nfs_treeq

func GetProtocolSecret

func GetProtocolSecret(ctx context.Context) (protocolSecret map[string]string, found bool, err error)

func ParseEndpoint

func ParseEndpoint(endpoint string) (string, string, error)

Types

type ControllerMock

type ControllerMock struct {
	mock.Mock
	storage.StorageOperations
}

func (*ControllerMock) ControllerExpandVolume

func (*ControllerMock) CreateSnapshot

func (*ControllerMock) CreateVolume

func (*ControllerMock) DeleteSnapshot

func (*ControllerMock) DeleteVolume

func (*ControllerMock) GetCapacity

func (*ControllerMock) ListSnapshots

func (*ControllerMock) ListVolumes

type ControllerServer

func NewControllerServer

func NewControllerServer(driver *Driver) *ControllerServer

func (*ControllerServer) ControllerExpandVolume

func (s *ControllerServer) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (expandVolResp *csi.ControllerExpandVolumeResponse, err error)

func (*ControllerServer) ControllerGetVolume

func (*ControllerServer) ControllerModifyVolume

func (s *ControllerServer) ControllerModifyVolume(ctx context.Context, req *csi.ControllerModifyVolumeRequest) (publishVolResp *csi.ControllerModifyVolumeResponse, err error)

ControllerModifyVolume method

func (*ControllerServer) ControllerPublishVolume

func (s *ControllerServer) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (publishVolResp *csi.ControllerPublishVolumeResponse, err error)

ControllerPublishVolume method

func (*ControllerServer) ControllerUnpublishVolume

func (s *ControllerServer) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (unpublishVolResp *csi.ControllerUnpublishVolumeResponse, err error)

ControllerUnpublishVolume method

func (*ControllerServer) CreateSnapshot

func (s *ControllerServer) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (createSnapshotResp *csi.CreateSnapshotResponse, err error)

func (*ControllerServer) CreateVolume

func (s *ControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (createVolResp *csi.CreateVolumeResponse, err error)

func (*ControllerServer) DeleteSnapshot

func (s *ControllerServer) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (deleteSnapshotResp *csi.DeleteSnapshotResponse, err error)

func (*ControllerServer) DeleteVolume

func (s *ControllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (deleteVolResp *csi.DeleteVolumeResponse, err error)

DeleteVolume method delete the volume

func (*ControllerServer) GetCapacity

func (*ControllerServer) ListSnapshots

func (*ControllerServer) ListVolumes

func (*ControllerServer) ValidateVolumeCapabilities

func (s *ControllerServer) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (validateVolCapsResponse *csi.ValidateVolumeCapabilitiesResponse, err error)

type Driver

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

func NewDriver

func NewDriver(options *DriverOptions) *Driver

func (*Driver) AddControllerServiceCapabilities

func (driver *Driver) AddControllerServiceCapabilities(capability []csi.ControllerServiceCapability_RPC_Type)

func (*Driver) AddGroupControllerServiceCapabilities

func (driver *Driver) AddGroupControllerServiceCapabilities(capability []csi.GroupControllerServiceCapability_RPC_Type)

func (*Driver) AddNodeServiceCapabilities

func (driver *Driver) AddNodeServiceCapabilities(capability []csi.NodeServiceCapability_RPC_Type)

func (*Driver) Run

func (driver *Driver) Run(testMode bool)

type DriverOptions

type DriverOptions struct {
	NodeID           string
	DriverName       string
	Endpoint         string
	Version          string
	MountPermissions uint64
	WorkingMountDir  string
}

type IdentityServer

type IdentityServer struct {
	Driver *Driver
	csi.UnimplementedIdentityServer
}

func NewDefaultIdentityServer

func NewDefaultIdentityServer(driver *Driver) *IdentityServer

func (*IdentityServer) GetPluginCapabilities

func (*IdentityServer) GetPluginInfo

func (*IdentityServer) Probe

Probe check whether the plugin is running or not. This method does not need to return anything. Currently the spec does not dictate what you should return either. Hence, return an empty response

type MockClient

type MockClient struct {
	mock.Mock
}

func (*MockClient) CreateSnapshotVolume

func (m *MockClient) CreateSnapshotVolume(snapshotParam *api.VolumeSnapshot) (*api.SnapshotVolumesResp, error)

func (*MockClient) CreateVolume

func (m *MockClient) CreateVolume(volume *api.VolumeParam, storagePoolName string) (*api.Volume, error)

func (*MockClient) DeleteVolume

func (m *MockClient) DeleteVolume(volumeId int) error

func (*MockClient) FindVolumeID

func (m *MockClient) FindVolumeID(volumename string) (int, error)

func (*MockClient) GetHostByName

func (m *MockClient) GetHostByName(hostName string) (api.Host, error)

func (*MockClient) GetNetworkSpaceByName

func (m *MockClient) GetNetworkSpaceByName(networkSpaceName string) (api.NetworkSpace, error)

func (*MockClient) GetVolume

func (m *MockClient) GetVolume(volumeid int) ([]api.Volume, error)

func (*MockClient) GetVolumeByName

func (m *MockClient) GetVolumeByName(volumename string) (*api.Volume, error)

func (*MockClient) InitRestClient

func (m *MockClient) InitRestClient() error

func (*MockClient) MapVolumeToHost

func (m *MockClient) MapVolumeToHost(hostID, volumeID int) (api.LunInfo, error)

func (*MockClient) NewClient

func (m *MockClient) NewClient() (*api.ClientService, error)

func (*MockClient) UnMapVolumeFromHost

func (m *MockClient) UnMapVolumeFromHost(hostID, volumeID int) error

type MockService

type MockService struct {
	mock.Mock
}

type NodeMock

type NodeMock struct {
	mock.Mock
	storage.StorageOperations
}

func (*NodeMock) NodeGetVolumeStats

func (*NodeMock) NodePublishVolume

func (*NodeMock) NodeStageVolume

func (*NodeMock) NodeUnpublishVolume

type NodeServer

type NodeServer struct {
	Driver *Driver

	csi.UnimplementedNodeServer
	// contains filtered or unexported fields
}

NodeServer driver

func NewNodeServer

func NewNodeServer(driver *Driver, mounter mount.Interface) *NodeServer

func (*NodeServer) NodeExpandVolume

func (*NodeServer) NodeGetCapabilities

func (*NodeServer) NodeGetInfo

func (*NodeServer) NodeGetVolumeStats

func (*NodeServer) NodePublishVolume

func (NodeServer) NodeStageVolume

func (*NodeServer) NodeUnpublishVolume

func (*NodeServer) NodeUnstageVolume

type NonBlockingGRPCServer

type NonBlockingGRPCServer interface {
	// Start services at the endpoint
	Start(endpoint string, ids csi.IdentityServer, vgs csi.GroupControllerServer, cs csi.ControllerServer, ns csi.NodeServer, testMode bool)
	// Waits for the service to stop
	Wait()
	// Stops the service gracefully
	Stop()
	// Stops the service forcefully
	ForceStop()
}

Defines Non blocking GRPC server interfaces

func NewNonBlockingGRPCServer

func NewNonBlockingGRPCServer() NonBlockingGRPCServer

type VolumeGroupServer

type VolumeGroupServer struct {
	Driver *Driver
	csi.UnimplementedGroupControllerServer
}

VolumeGroupServer controller server setting

func NewVolumeGroupServer

func NewVolumeGroupServer(driver *Driver) *VolumeGroupServer

func (*VolumeGroupServer) CreateVolumeGroupSnapshot

func (*VolumeGroupServer) DeleteVolumeGroupSnapshot

func (*VolumeGroupServer) GetVolumeGroupSnapshot

Jump to

Keyboard shortcuts

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