nvmf

package
v0.0.0-...-18f1d04 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Copyright 2021 The Kubernetes Authors.

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 (
	NVMF_NQN_SIZE = 223
	SYS_NVMF      = "/sys/class/nvme"
	RUN_NVMF      = "/run/nvmf"
)
View Source
const (
	ENOENT = 1 /* No such file or directory */
	EINVAL = 2 /* Invalid argument */
)

Here erron

View Source
const (
	DefaultDriverName        = "csi.nvmf.com"
	DefaultDriverServicePort = "12230"
	DefaultDriverVersion     = "v1.0.0"

	DefaultVolumeMapPath = "/var/lib/nvmf/volumes"
)

Variables

This section is empty.

Functions

func AttachDisk

func AttachDisk(req *csi.NodePublishVolumeRequest, nm nvmfDiskMounter) (string, error)

func DetachDisk

func DetachDisk(volumeID string, num *nvmfDiskUnMounter, targetPath string) error

func GetDeviceNameByVolumeID

func GetDeviceNameByVolumeID(volumeID string) (deviceName string, err error)

func NewDriver

func NewDriver(conf *GlobalConfig) *driver

NewDriver create the identity/node

Types

type Connector

type Connector struct {
	VolumeID      string
	DeviceUUID    string
	TargetNqn     string
	TargetAddr    string
	TargetPort    string
	Transport     string
	HostNqn       string
	RetryCount    int32
	CheckInterval int32
}

func GetConnectorFromFile

func GetConnectorFromFile(filePath string) (*Connector, error)

func (*Connector) Connect

func (c *Connector) Connect() (string, error)

connect to volume to this node and return devicePath

func (*Connector) Disconnect

func (c *Connector) Disconnect() error

we disconnect only by nqn

type ControllerServer

type ControllerServer struct {
	Driver *driver
}

func NewControllerServer

func NewControllerServer(d *driver) *ControllerServer

create controller server

func (*ControllerServer) ControllerExpandVolume

func (*ControllerServer) ControllerGetCapabilities

func (*ControllerServer) ControllerGetVolume

func (*ControllerServer) ControllerPublishVolume

func (*ControllerServer) ControllerUnpublishVolume

func (*ControllerServer) CreateSnapshot

func (*ControllerServer) CreateVolume

You should realize your volume provider here, such as requesting the Cloud to create an NVMf block and returning specific information to you

func (*ControllerServer) DeleteSnapshot

func (*ControllerServer) DeleteVolume

func (*ControllerServer) GetCapacity

func (*ControllerServer) ListSnapshots

func (*ControllerServer) ListVolumes

func (*ControllerServer) ValidateVolumeCapabilities

type GlobalConfig

type GlobalConfig struct {
	NVMfVolumeMapDir   string
	DriverName         string
	Region             string
	NodeID             string
	Endpoint           string // CSI endpoint
	Version            string
	IsControllerServer bool
	LogLevel           string
}

type IdentityServer

type IdentityServer struct {
	Driver *driver
}

func NewIdentityServer

func NewIdentityServer(d *driver) *IdentityServer

Create IdentityServer

func (*IdentityServer) GetPluginCapabilities

func (*IdentityServer) GetPluginInfo

func (*IdentityServer) Probe

type NoControllerError

type NoControllerError struct {
	Nqn     string
	Hostnqn string
}

func (*NoControllerError) Error

func (e *NoControllerError) Error() string

type NodeServer

type NodeServer struct {
	Driver *driver
}

func NewNodeServer

func NewNodeServer(d *driver) *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, cs csi.ControllerServer, ns csi.NodeServer)
	// 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 UnsupportedHostnqnError

type UnsupportedHostnqnError struct {
	Target string
}

func (*UnsupportedHostnqnError) Error

func (e *UnsupportedHostnqnError) Error() string

Jump to

Keyboard shortcuts

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