Documentation
¶
Overview ¶
Copyright (c) 2019 Dell EMC Corporation All Rights Reserved
Index ¶
- Constants
- Variables
- func GetRunidLog(ctx context.Context) (context.Context, *logrus.Entry, string)
- func SingleAccessMode(accMode *csi.VolumeCapability_AccessMode) bool
- func ValidateAndGetProtocol(ctx context.Context, protocol, scProtocol string) (string, error)
- func ValidateControllerPublishRequest(ctx context.Context, req *csi.ControllerPublishVolumeRequest, ...) (protocol, nodeID string, err error)
- func ValidateCreateVolumeRequest(ctx context.Context, req *csi.CreateVolumeRequest) (protocol, storagePool string, size, tieringPolicy, hostIoSize int64, ...)
- type CRParams
- type Device
- type ISCSITargetInfo
- type Opts
- type Service
- type StorageArrayConfig
- type StorageArrayList
Constants ¶
const ( FC = "FC" ISCSI = "iSCSI" NFS = "NFS" ProtocolUnknown = "Unknown" ProtocolNFS = int(0) MAX_ENTRIES_SNAPSHOT = 100 MAX_ENTRIES_VOLUME = 100 AdditionalFilesystemSize = 1.5 * 1024 * 1024 * 1024 )
const ( Iscsi = "iscsi" Fc = "fc" Nfs = "nfs" )
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" )
const ( // VendorVersion is the version of this Unity CSI. VendorVersion = "0.0.0" //Tcp dial default timeout in Milliseconds TcpDialTimeout = 1000 IScsiPort = "3260" )
Variables ¶
var ( LUNZHLU = 0 VolumeNameLengthConstraint = 63 )
var CollectionWait = (MetricsCollectionInterval + 1) * 1000
var CreateMetricsCollection = createMetricsCollection
var DriverConfig string
var FindHostInitiatorById = findHostInitiatorById
var GetArrayIdFromVolumeContext = getArrayIdFromVolumeContext
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.
var GetMetricsCollection = getMetricsCollection
var GetProtocolFromVolumeContext = getProtocolFromVolumeContext
var GetUnityClient = getUnityClient
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.
var MetricsCollectionInterval = 5 // seconds
MetricsCollectionInterval is used for interval to use in the creation of a Unity MetricsCollection
var Name string
var RefreshDuration = refreshInterval * time.Second
var RequireProbe = requireProbe
Functions ¶
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 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 ISCSITargetInfo ¶
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.
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