service

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Overview

Copyright (c) 2019 Dell EMC Corporation All Rights Reserved

Index

Constants

View Source
const (
	FC                       = "FC"
	ISCSI                    = "iSCSI"
	NFS                      = "NFS"
	ProtocolUnknown          = "Unknown"
	ProtocolNFS              = int(0)
	MAX_ENTRIES_SNAPSHOT     = 100
	MAX_ENTRIES_VOLUME       = 100
	NFSShareLocalPath        = "/"
	NFSShareNamePrefix       = "csishare-"
	AdditionalFilesystemSize = 1.5 * 1024 * 1024 * 1024
)
View Source
const (
	Iscsi = "iscsi"
	Fc    = "fc"
	Nfs   = "nfs"
)
View Source
const (
	// EnvEndpoint is the name of the environment variable used to set the
	// HTTP endpoint of the Unity Gateway
	EnvEndpoint = "X_CSI_UNITY_ENDPOINT"

	// EnvNodeName is the name of the enviroment variable used to set the
	// hostname where the node service is running
	EnvNodeName = "X_CSI_UNITY_NODENAME"

	// EnvAutoProbe is the name of the environment variable used to specify
	// that the controller service should automatically probe itself if it
	// receives incoming requests before having been probed, in direct
	// violation of the CSI spec
	EnvAutoProbe = "X_CSI_UNITY_AUTOPROBE"

	//EnvPvtMountDir is required to Node Unstage volume where the volume has been mounted
	//as a global mount via CSI-Unity v1.0 or v1.1
	EnvPvtMountDir = "X_CSI_PRIVATE_MOUNT_DIR"

	//EnvEphemeralStagingPath
	EnvEphemeralStagingPath = "X_CSI_EPHEMERAL_STAGING_PATH"

	// EnvISCSIChroot is the path to which the driver will chroot before
	// running any iscsi commands. This value should only be set when instructed
	// by technical support.
	EnvISCSIChroot = "X_CSI_ISCSI_CHROOT"

	// EnvKubeConfigPath indicates kubernetes configuration that has to be used by CSI Driver
	EnvKubeConfigPath = "KUBECONFIG"

	//Time interval to add node info to array. Default 60 minutes.
	//X_CSI_UNITY_SYNC_NODEINFO_INTERVAL has been deprecated and will be removes in a future release
	SyncNodeInfoTimeInterval = "X_CSI_UNITY_SYNC_NODEINFO_INTERVAL"

	// EnvAllowRWOMultiPodAccess - Environment variable to configure sharing of a single volume across multiple pods within the same node
	// Multi-node access is still not allowed for ReadWriteOnce Mount volumes.
	// Enabling this option techincally violates the CSI 1.3 spec in the NodePublishVolume stating the required error returns.
	//X_CSI_UNITY_ALLOW_MULTI_POD_ACCESS has been deprecated and will be removes in a future release
	EnvAllowRWOMultiPodAccess = "X_CSI_UNITY_ALLOW_MULTI_POD_ACCESS"
)
View Source
const (

	// VendorVersion is the version of this Unity CSI.
	VendorVersion = "0.0.0"

	//Tcp dial default timeout in Milliseconds
	TcpDialTimeout = 1000

	IScsiPort = "3260"
)

Variables

View Source
var (
	LUNZHLU = 0

	VolumeNameLengthConstraint = 63
)
View Source
var CollectionWait = (MetricsCollectionInterval + 1) * 1000
View Source
var CreateMetricsCollection = createMetricsCollection
View Source
var DriverConfig string
View Source
var FindHostInitiatorById = findHostInitiatorById
View Source
var GetArrayIdFromVolumeContext = getArrayIdFromVolumeContext
View Source
var GetHostId = getHostId

References to calls to services outside of this function. The reference the real implementations by default; they are here so that they can be mocked out.

View Source
var GetMetricsCollection = getMetricsCollection
View Source
var GetProtocolFromVolumeContext = getProtocolFromVolumeContext
View Source
var GetUnityClient = getUnityClient
View Source
var Manifest = map[string]string{
	"url":    "http://github.com/dell/csi-unity",
	"semver": core.SemVer,
	"commit": core.CommitSha32,
	"formed": core.CommitTime.Format(time.RFC1123),
}

Manifest is the SP's manifest.

View Source
var MetricsCollectionInterval = 5 // seconds

MetricsCollectionInterval is used for interval to use in the creation of a Unity MetricsCollection

View Source
var Name string
View Source
var RefreshDuration = refreshInterval * time.Second
View Source
var RequireProbe = requireProbe

Functions

func GetRunidLog

func GetRunidLog(ctx context.Context) (context.Context, *logrus.Entry, string)

func SingleAccessMode added in v1.4.0

func SingleAccessMode(accMode *csi.VolumeCapability_AccessMode) bool

SingleAccessMode returns true if only a single access is allowed SINGLE_NODE_WRITER or SINGLE_NODE_READER_ONLY

func ValidateAndGetProtocol added in v1.4.0

func ValidateAndGetProtocol(ctx context.Context, protocol, scProtocol string) (string, error)

func ValidateControllerPublishRequest added in v1.4.0

func ValidateControllerPublishRequest(ctx context.Context, req *csi.ControllerPublishVolumeRequest, contextProtocol string) (protocol, nodeID string, err error)

ValidateControllerPublishRequest - method to validate Controller publish volume request

func ValidateCreateVolumeRequest added in v1.4.0

func ValidateCreateVolumeRequest(ctx context.Context, req *csi.CreateVolumeRequest) (protocol, storagePool string, size, tieringPolicy, hostIoSize int64, thin, dataReduction bool, err error)

ValidateCreateVolumeRequest - Validates all mandatory parameters in create volume request

Types

type CRParams added in v1.4.0

type CRParams struct {
	VolumeName      string
	Protocol        string
	StoragePool     string
	Desciption      string
	HostIOLimitName string
	Thin            bool
	DataReduction   bool
	Size            int64
	TieringPolicy   int64
	HostIoSize      int64
}

CRParams - defines placeholder for all create volume parameters

type Device

type Device struct {
	FullPath string
	Name     string
	RealDev  string
}

Device is a struct for holding details about a block device

func GetDevice

func GetDevice(ctx context.Context, path string) (*Device, error)

GetDevice returns a Device struct with info about the given device, or an error if it doesn't exist or is not a block device

type ISCSITargetInfo

type ISCSITargetInfo struct {
	Portal string
	Target string
}

ISCSITargetInfo represents basic information about iSCSI target

type Opts

type Opts struct {
	NodeName                      string
	LongNodeName                  string
	Chroot                        string
	Thick                         bool
	AutoProbe                     bool
	AllowRWOMultiPodAccess        bool
	PvtMountDir                   string
	Debug                         bool
	SyncNodeInfoTimeInterval      int64
	EnvEphemeralStagingTargetPath string
	KubeConfigPath                string
	MaxVolumesPerNode             int64
	LogLevel                      string
}

Opts defines service configuration options.

type Service

type Service interface {
	csi.ControllerServer
	csi.IdentityServer
	csi.NodeServer
	BeforeServe(context.Context, *gocsi.StoragePlugin, net.Listener) error
	RegisterAdditionalServers(*grpc.Server)
}

Service is a CSI SP and idempotency.Provider.

func New

func New() Service

New returns a new CSI Service.

type StorageArrayConfig

type StorageArrayConfig struct {
	ArrayId                   string `json:"arrayId" yaml:"arrayId"`
	Username                  string `json:"username" yaml:"username"`
	Password                  string `json:"password" yaml:"password"`
	RestGateway               string `json:"restGateway" yaml:"restGateway"`                           // To be deprecated in future
	Insecure                  *bool  `json:"insecure,omitempty" yaml:"insecure,omitempty"`             // To be deprecated in future
	IsDefaultArrayParam       *bool  `json:"isDefaultArray,omitempty" yaml:"isDefaultArray,omitempty"` // To be deprecated in future
	Endpoint                  string `json:"endpoint,omitempty" yaml:"endpoint,omitempty"`
	IsDefault                 *bool  `json:"isDefault,omitempty" yaml:"isDefault,omitempty"`
	SkipCertificateValidation *bool  `json:"skipCertificateValidation,omitempty" yaml:"skipCertificateValidation,omitempty"`
	IsProbeSuccess            bool
	IsHostAdded               bool
	IsDefaultArray            bool
	UnityClient               *gounity.Client
}

func (StorageArrayConfig) String

func (s StorageArrayConfig) String() string

To display the StorageArrayConfig content

type StorageArrayList

type StorageArrayList struct {
	StorageArrayList         []StorageArrayConfig `json:"storageArrayList" yaml:"storageArrayList"`
	LogLevel                 string               `json:"logLevel" yaml:"logLevel"`
	MaxUnityVolumesPerNode   int64                `json:"maxUnityVolumesPerNode,omitempty" yaml:"maxUnityVolumesPerNode,omitempty"`
	AllowRWOMultiPodAccess   *bool                `json:"allowRWOMultiPodAccess,omitempty" yaml:"allowRWOMultiPodAccess,omitempty"`
	SyncNodeInfoTimeInterval *int64               `json:"syncNodeInfoTimeInterval,omitempty" yaml:"syncNodeInfoTimeInterval,omitempty"`
}

To parse the secret json file

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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