Documentation
¶
Index ¶
- Constants
- func GenerateVolumePublishName(volumeID, nodeID string) string
- type DFInfo
- type FCPAccessInfo
- type FibreChannelAccessInfo
- type HostSystem
- type ISCSIAction
- type ISCSIDiscoveryInfo
- type ISCSISessionData
- type ISCSISessions
- func (p *ISCSISessions) AddLUNToPortal(portal string, lData LUNData) error
- func (p *ISCSISessions) AddPortal(portal string, portalInfo PortalInfo) error
- func (p *ISCSISessions) CheckPortalExists(portal string) bool
- func (p *ISCSISessions) GeneratePublishInfo(portal string) (*VolumePublishInfo, error)
- func (p *ISCSISessions) GoString() string
- func (p *ISCSISessions) ISCSISessionData(portal string) (*ISCSISessionData, error)
- func (p *ISCSISessions) IsEmpty() bool
- func (p *ISCSISessions) LUNInfo(portal string) (*LUNs, error)
- func (p *ISCSISessions) LUNsForPortal(portal string) ([]int32, error)
- func (p *ISCSISessions) PortalInfo(portal string) (*PortalInfo, error)
- func (p *ISCSISessions) RemoveLUNFromPortal(portal string, lunID int32)
- func (p *ISCSISessions) RemovePortal(portal string)
- func (p *ISCSISessions) ResetAllRemediationValues() error
- func (p *ISCSISessions) ResetPortalRemediationValue(portal string) error
- func (p *ISCSISessions) String() string
- func (p *ISCSISessions) UpdateAndRecordPortalInfoChanges(portal string, portalInfo PortalInfo) (string, error)
- func (p *ISCSISessions) UpdateCHAPForPortal(portal string, newCHAP IscsiChapInfo) error
- func (p *ISCSISessions) VolumeIDForPortal(portal string) (string, error)
- func (p *ISCSISessions) VolumeIDForPortalAndLUN(portal string, lunID int32) (string, error)
- type IscsiAccessInfo
- type IscsiChapInfo
- type LUNData
- type LUNs
- func (l *LUNs) AddLUN(m LUNData)
- func (l *LUNs) AllLUNs() []int32
- func (l *LUNs) CheckLUNExists(x int32) bool
- func (l *LUNs) IdentifyMissingLUNs(m LUNs) []int32
- func (l *LUNs) IsEmpty() bool
- func (l *LUNs) RemoveLUN(x int32)
- func (l *LUNs) String() string
- func (l *LUNs) VolumeID(x int32) (string, error)
- type MountInfo
- type MountPoint
- type NVMeAccessInfo
- type NfsAccessInfo
- type Node
- type NodeExternal
- type NodePrep
- type NodePrepBreadcrumb
- type NodePrepStatus
- type NodePublicationState
- type NodePublicationStateFlags
- type PortalInfo
- func (p *PortalInfo) CHAPInUse() bool
- func (p *PortalInfo) HasTargetIQN() bool
- func (p *PortalInfo) IsFirstIdentifiedStaleAtSet() bool
- func (p *PortalInfo) IsValid() bool
- func (p *PortalInfo) RecordChanges(m PortalInfo) string
- func (p *PortalInfo) ResetFirstIdentifiedStaleAt()
- func (p *PortalInfo) String() string
- func (p *PortalInfo) UpdateCHAPCredentials(credentials IscsiChapInfo)
- type PortalInvalid
- type SMBAccessInfo
- type ScsiDeviceAddress
- type ScsiDeviceInfo
- type SystemOS
- type VolumeAccessInfo
- type VolumePublication
- type VolumePublicationExternal
- type VolumePublishInfo
- type VolumeTrackingInfo
- type VolumeTrackingPublishInfo
- type VolumeUpdateInfo
Constants ¶
const ( ScanAllSCSIDeviceAddress = "-" ScanSCSIDeviceAddressZero = "0" )
const ( NodeDirty = NodePublicationState("dirty") NodeCleanable = NodePublicationState("cleanable") NodeClean = NodePublicationState("clean") )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FCPAccessInfo ¶
type FCPAccessInfo struct { FibreChannelAccessInfo FCPLunNumber int32 `json:"fcpLunNumber,omitempty"` FCPIgroup string `json:"fcpIgroup,omitempty"` FCPLunSerial string `json:"fcpLunSerial,omitempty"` }
type FibreChannelAccessInfo ¶
type FibreChannelAccessInfo struct {
FCTargetWWNN string `json:"fcTargetWWNN,omitempty"`
}
type HostSystem ¶
type ISCSIAction ¶
type ISCSIAction int8
ISCSIAction is a data structure for iSCSI self-healing actions
const ( NoAction ISCSIAction = iota Scan LoginScan LogoutLoginScan )
func (ISCSIAction) String ¶
func (a ISCSIAction) String() string
type ISCSIDiscoveryInfo ¶
ISCSIDiscoveryInfo contains information about discovered iSCSI targets.
type ISCSISessionData ¶
type ISCSISessionData struct { PortalInfo PortalInfo LUNs LUNs Remediation ISCSIAction }
type ISCSISessions ¶
type ISCSISessions struct {
Info map[string]*ISCSISessionData
}
func (*ISCSISessions) AddLUNToPortal ¶
func (p *ISCSISessions) AddLUNToPortal(portal string, lData LUNData) error
AddLUNToPortal adds a LUNInfo to a pre-existing portal entry in the map
func (*ISCSISessions) AddPortal ¶
func (p *ISCSISessions) AddPortal(portal string, portalInfo PortalInfo) error
AddPortal creates a portal entry along with PortalInfo but without any LUNInfo
func (*ISCSISessions) CheckPortalExists ¶
func (p *ISCSISessions) CheckPortalExists(portal string) bool
CheckPortalExists checks whether the portal is already in the map
func (*ISCSISessions) GeneratePublishInfo ¶
func (p *ISCSISessions) GeneratePublishInfo(portal string) (*VolumePublishInfo, error)
func (*ISCSISessions) GoString ¶
func (p *ISCSISessions) GoString() string
GoString prints Go-syntax representation of the map
func (*ISCSISessions) ISCSISessionData ¶
func (p *ISCSISessions) ISCSISessionData(portal string) (*ISCSISessionData, error)
ISCSISessionData returns the PortalInfo and LUNInfo associated to a portal
func (*ISCSISessions) IsEmpty ¶
func (p *ISCSISessions) IsEmpty() bool
IsEmpty identifies whether portal to LUN mapping is empty or not.
func (*ISCSISessions) LUNInfo ¶
func (p *ISCSISessions) LUNInfo(portal string) (*LUNs, error)
LUNInfo returns LUNInfo for a given portal.
func (*ISCSISessions) LUNsForPortal ¶
func (p *ISCSISessions) LUNsForPortal(portal string) ([]int32, error)
LUNsForPortal returns the list of LUNs associated with this portal
func (*ISCSISessions) PortalInfo ¶
func (p *ISCSISessions) PortalInfo(portal string) (*PortalInfo, error)
PortalInfo returns portal info for a given portal.
func (*ISCSISessions) RemoveLUNFromPortal ¶
func (p *ISCSISessions) RemoveLUNFromPortal(portal string, lunID int32)
RemoveLUNFromPortal removes a LUNInfo from the given portal mapping If it is the last LUNInfo corresponding to a portal, then portal is removed from the map as well
func (*ISCSISessions) RemovePortal ¶
func (p *ISCSISessions) RemovePortal(portal string)
RemovePortal removes portal (along with its PortalInfo and LUNInfo) from the map
func (*ISCSISessions) ResetAllRemediationValues ¶
func (p *ISCSISessions) ResetAllRemediationValues() error
ResetAllRemediationValues resets remediation information associated with all the portals
func (*ISCSISessions) ResetPortalRemediationValue ¶
func (p *ISCSISessions) ResetPortalRemediationValue(portal string) error
ResetPortalRemediationValue resets remediation information associated with the portal
func (*ISCSISessions) String ¶
func (p *ISCSISessions) String() string
String prints values of the map
func (*ISCSISessions) UpdateAndRecordPortalInfoChanges ¶
func (p *ISCSISessions) UpdateAndRecordPortalInfoChanges(portal string, portalInfo PortalInfo) (string, error)
UpdateAndRecordPortalInfoChanges updates the portal information associated with the portal and identifies changes to the portal info (if any)
func (*ISCSISessions) UpdateCHAPForPortal ¶
func (p *ISCSISessions) UpdateCHAPForPortal(portal string, newCHAP IscsiChapInfo) error
UpdateCHAPForPortal updates the CHAP information associated with the portal
func (*ISCSISessions) VolumeIDForPortal ¶
func (p *ISCSISessions) VolumeIDForPortal(portal string) (string, error)
VolumeIDForPortal to get any valid volume ID behind a given portal.
func (*ISCSISessions) VolumeIDForPortalAndLUN ¶
func (p *ISCSISessions) VolumeIDForPortalAndLUN(portal string, lunID int32) (string, error)
VolumeIDForPortalAndLUN to get any valid volume ID behind a given portal.
type IscsiAccessInfo ¶
type IscsiAccessInfo struct { IscsiTargetPortal string `json:"iscsiTargetPortal,omitempty"` IscsiPortals []string `json:"iscsiPortals,omitempty"` IscsiTargetIQN string `json:"iscsiTargetIqn,omitempty"` IscsiLunNumber int32 `json:"iscsiLunNumber,omitempty"` IscsiInterface string `json:"iscsiInterface,omitempty"` IscsiIgroup string `json:"iscsiIgroup,omitempty"` IscsiVAGs []int64 `json:"iscsiVags,omitempty"` IscsiLunSerial string `json:"iscsiLunSerial,omitempty"` IscsiChapInfo }
type IscsiChapInfo ¶
type IscsiChapInfo struct { UseCHAP bool `json:"useCHAP"` IscsiUsername string `json:"iscsiUsername,omitempty"` IscsiInitiatorSecret string `json:"iscsiInitiatorSecret,omitempty"` IscsiTargetUsername string `json:"iscsiTargetUsername,omitempty"` IscsiTargetSecret string `json:"iscsiTargetSecret,omitempty"` }
func (IscsiChapInfo) String ¶
func (i IscsiChapInfo) String() string
String implements the stringer interface and ensures that sensitive fields are redacted before being logged/printed
type LUNs ¶
func (*LUNs) CheckLUNExists ¶
CheckLUNExists verifies whether the given LUN exists in LUNs map
func (*LUNs) IdentifyMissingLUNs ¶
IdentifyMissingLUNs returns the missing LUNs i.e., existing in m but not in l.
type MountInfo ¶
type MountInfo struct { MountId int ParentId int DeviceId string Root string MountPoint string MountOptions []string FsType string MountSource string SuperOptions []string }
MountInfo represents a single line in /proc/self/mountinfo.
type MountPoint ¶
MountPoint represents a single line in /proc/mounts or /etc/fstab.
type NVMeAccessInfo ¶
type NfsAccessInfo ¶
type Node ¶
type Node struct { Name string `json:"name"` IQN string `json:"iqn,omitempty"` NQN string `json:"nqn,omitempty"` HostWWPNMap map[string][]string `json:"hostWWPNMap,omitempty"` IPs []string `json:"ips,omitempty"` TopologyLabels map[string]string `json:"topologyLabels,omitempty"` NodePrep *NodePrep `json:"nodePrep,omitempty"` HostInfo *HostSystem `json:"hostInfo,omitempty"` Deleted bool `json:"deleted"` PublicationState NodePublicationState `json:"publicationState"` LogLevel string `json:"logLevel"` LogWorkflows string `json:"logWorkflows"` LogLayers string `json:"logLayers"` }
func (*Node) ConstructExternal ¶
func (n *Node) ConstructExternal() *NodeExternal
ConstructExternal returns an externally facing representation of the Node.
type NodeExternal ¶
type NodeExternal struct { Name string `json:"name"` IQN string `json:"iqn,omitempty"` NQN string `json:"nqn,omitempty"` HostWWPNMap map[string][]string `json:"hostWWPNMap,omitempty"` IPs []string `json:"ips,omitempty"` TopologyLabels map[string]string `json:"topologyLabels,omitempty"` NodePrep *NodePrep `json:"nodePrep,omitempty"` HostInfo *HostSystem `json:"hostInfo,omitempty"` Deleted *bool `json:"deleted,omitempty"` PublicationState NodePublicationState `json:"publicationState,omitempty"` LogLevel string `json:"logLevel"` LogWorkflows string `json:"logWorkflows"` LogLayers string `json:"logLayers"` }
type NodePrep ¶
type NodePrep struct { Enabled bool `json:"enabled"` NFS NodePrepStatus `json:"nfs,omitempty"` NFSStatusMessage string `json:"nfsStatusMessage,omitempty"` ISCSI NodePrepStatus `json:"iscsi,omitempty"` ISCSIStatusMessage string `json:"iscsiStatusMessage,omitempty"` }
NodePrep struct is deprecated and only here for backwards compatibility
type NodePrepBreadcrumb ¶
type NodePrepStatus ¶
type NodePrepStatus string
type NodePublicationState ¶
type NodePublicationState string
type NodePublicationStateFlags ¶
type NodePublicationStateFlags struct { OrchestratorReady *bool `json:"orchestratorReady,omitempty"` // Is the node in a state such that volumes may be published? AdministratorReady *bool `json:"administratorReady,omitempty"` // Should new publications be allowed? ProvisionerReady *bool `json:"provisionerReady,omitempty"` // Is publishing volumes to this node safe for the backend? }
func (*NodePublicationStateFlags) IsNodeCleanable ¶
func (f *NodePublicationStateFlags) IsNodeCleanable() bool
func (*NodePublicationStateFlags) IsNodeCleaned ¶
func (f *NodePublicationStateFlags) IsNodeCleaned() bool
func (*NodePublicationStateFlags) IsNodeDirty ¶
func (f *NodePublicationStateFlags) IsNodeDirty() bool
func (*NodePublicationStateFlags) String ¶
func (f *NodePublicationStateFlags) String() string
type PortalInfo ¶
type PortalInfo struct { ISCSITargetIQN string SessionNumber string // Should only be set when capturing current state of the Portal Credentials IscsiChapInfo ReasonInvalid PortalInvalid // A portal may be in an invalid state, if so then why? LastAccessTime time.Time // Time at which there was an attempt to self-heal session FirstIdentifiedStaleAt time.Time // Time at which session was first identified to be stale Source string // Source of the portal Info }
func (*PortalInfo) CHAPInUse ¶
func (p *PortalInfo) CHAPInUse() bool
CHAPInUse identifies whether CHAP is set or not
func (*PortalInfo) HasTargetIQN ¶
func (p *PortalInfo) HasTargetIQN() bool
HasTargetIQN verifies if target IQN is set or not
func (*PortalInfo) IsFirstIdentifiedStaleAtSet ¶
func (p *PortalInfo) IsFirstIdentifiedStaleAtSet() bool
IsFirstIdentifiedStaleAtSet identifies if FirstIdentifiedStaleAt time is set or not
func (*PortalInfo) IsValid ¶
func (p *PortalInfo) IsValid() bool
IsValid verifies if PortalInfo is valid or not
func (*PortalInfo) RecordChanges ¶
func (p *PortalInfo) RecordChanges(m PortalInfo) string
RecordChanges compares a given portal info with another portal info and record changes
func (*PortalInfo) ResetFirstIdentifiedStaleAt ¶
func (p *PortalInfo) ResetFirstIdentifiedStaleAt()
ResetFirstIdentifiedStaleAt reset FirstIdentifiedStaleAt time to its zero value
func (*PortalInfo) String ¶
func (p *PortalInfo) String() string
func (*PortalInfo) UpdateCHAPCredentials ¶
func (p *PortalInfo) UpdateCHAPCredentials(credentials IscsiChapInfo)
UpdateCHAPCredentials updates Portal's CHAP credentials
type PortalInvalid ¶
type PortalInvalid int8
PortalInvalid is a data structure for iSCSI self-healing capturing Portal's invalid non-recoverable state
const ( NotInvalid PortalInvalid = iota MissingTargetIQN MissingMpathDevice DuplicatePortals )
func (PortalInvalid) String ¶
func (a PortalInvalid) String() string
type SMBAccessInfo ¶
type ScsiDeviceAddress ¶
ScsiDeviceAddress is a data structure for representing a SCSI device address
type ScsiDeviceInfo ¶
type ScsiDeviceInfo struct { ScsiDeviceAddress Devices []string DevicePaths []string MultipathDevice string Filesystem string IQN string WWNN string SessionNumber int CHAPInfo IscsiChapInfo }
ScsiDeviceInfo contains information about SCSI devices
type VolumeAccessInfo ¶
type VolumeAccessInfo struct { IscsiAccessInfo NVMeAccessInfo NfsAccessInfo SMBAccessInfo FCPAccessInfo MountOptions string `json:"mountOptions,omitempty"` FormatOptions string `json:"formatOptions,omitempty"` PublishEnforcement bool `json:"publishEnforcement,omitempty"` ReadOnly bool `json:"readOnly,omitempty"` // The access mode values are defined by CSI // See https://github.com/container-storage-interface/spec/blob/release-1.5/lib/go/csi/csi.pb.go#L135 AccessMode int32 `json:"accessMode,omitempty"` }
type VolumePublication ¶
type VolumePublication struct { Name string `json:"name"` NodeName string `json:"node"` VolumeName string `json:"volume"` ReadOnly bool `json:"readOnly"` // The access mode values are defined by CSI // See https://github.com/container-storage-interface/spec/blob/release-1.5/lib/go/csi/csi.pb.go#L135 AccessMode int32 `json:"accessMode"` }
func (*VolumePublication) ConstructExternal ¶
func (v *VolumePublication) ConstructExternal() *VolumePublicationExternal
ConstructExternal returns an externally facing representation of the VolumePublication.
func (*VolumePublication) Copy ¶
func (v *VolumePublication) Copy() *VolumePublication
Copy returns a new copy of the VolumePublication.
type VolumePublicationExternal ¶
type VolumePublicationExternal struct { Name string `json:"name"` NodeName string `json:"node"` VolumeName string `json:"volume"` ReadOnly bool `json:"readOnly"` // The access mode values are defined by CSI // See https://github.com/container-storage-interface/spec/blob/release-1.5/lib/go/csi/csi.pb.go#L135 AccessMode int32 `json:"accessMode"` }
type VolumePublishInfo ¶
type VolumePublishInfo struct { Localhost bool `json:"localhost,omitempty"` HostIQN []string `json:"hostIQN,omitempty"` HostNQN string `json:"hostNQN,omitempty"` HostWWPNMap map[string][]string `json:"hostWWPNMap,omitempty"` HostIP []string `json:"hostIP,omitempty"` BackendUUID string `json:"backendUUID,omitempty"` Nodes []*Node `json:"nodes,omitempty"` HostName string `json:"hostName,omitempty"` FilesystemType string `json:"fstype,omitempty"` DevicePath string `json:"devicePath,omitempty"` RawDevicePath string `json:"rawDevicePath,omitempty"` // NOTE: devicePath was renamed to this 23.01-23.04 Unmanaged bool `json:"unmanaged,omitempty"` StagingMountpoint string `json:"stagingMountpoint,omitempty"` // NOTE: Added in 22.04 release TridentUUID string `json:"tridentUUID,omitempty"` // NOTE: Added in 22.07 release LUKSEncryption string `json:"LUKSEncryption,omitempty"` SANType string `json:"SANType,omitempty"` VolumeAccessInfo }
type VolumeTrackingInfo ¶
type VolumeTrackingInfo struct { VolumePublishInfo VolumeTrackingInfoPath string StagingTargetPath string `json:"stagingTargetPath"` PublishedPaths map[string]struct{} `json:"publishedTargetPaths"` }
type VolumeTrackingPublishInfo ¶
type VolumeTrackingPublishInfo struct {
StagingTargetPath string `json:"stagingTargetPath"`
}