Documentation ¶
Overview ¶
Package utils ...
Package utils ...
Package utils ...
Package utils ...
Package utils ...
Index ¶
- Constants
- Variables
- func BytesToGiB(volumeSizeBytes int64) int
- func GetContextLogger(ctx context.Context, isDebug bool) (*zap.Logger, string)
- func GetContextLoggerWithRequestID(ctx context.Context, isDebug bool, requestIDIn *string) (*zap.Logger, string)
- func GetTestLogger(t *testing.T) (logger *zap.Logger, teardown func())
- func ListContainsSubstr(mainStr []string, subStr string) bool
- func NewControllerServiceCapability(cap csi.ControllerServiceCapability_RPC_Type) *csi.ControllerServiceCapability
- func NewNodeServiceCapability(cap csi.NodeServiceCapability_RPC_Type) *csi.NodeServiceCapability
- func NewVolumeCapabilityAccessMode(mode csi.VolumeCapability_AccessMode_Mode) *csi.VolumeCapability_AccessMode
- func RoundUpBytes(volumeSizeBytes int64) int64
- type ClusterInfo
- type LockStore
Constants ¶
View Source
const ( // GiB in bytes GiB = 1024 * 1024 * 1024 // MinimumVolumeSizeInBytes minimum size of the volume in bytes MinimumVolumeSizeInBytes int64 = 10 * GiB // MaximumVolumeSizeInBytes the max allowed capacity MaximumVolumeSizeInBytes int64 = 2 * 1024 * GiB //2000GB = 2TB // MinimumVolumeDiskSizeInGb minimum size of the volume in GB MinimumVolumeDiskSizeInGb = 10 // MaximumVolumeDiskSizeInGb ... MaximumVolumeDiskSizeInGb = 2048 // DefaultVolumeDiskSizeinGb default size of the volume in GB DefaultVolumeDiskSizeinGb = 10 // MaxRetryAttemptForSessions ... MaxRetryAttemptForSessions = 2 )
View Source
const ( // KB ... KB = 1 << (10 * iota) // MB ... MB // GB ... GB // TB ... TB )
View Source
const ( // ClusterInfoPath ... ClusterInfoPath = "cluster_info/cluster-config.json" // NodeZoneLabel Zone Label attached to node NodeZoneLabel = "failure-domain.beta.kubernetes.io/zone" // NodeRegionLabel Region Label attached to node NodeRegionLabel = "failure-domain.beta.kubernetes.io/region" // NodeInstanceIDLabel VPC ID label attached to satellite host NodeInstanceIDLabel = "ibm-cloud.kubernetes.io/vpc-instance-id" // MachineTypeLabel is the node label used to identify the cluster type (upi,ipi,etc) MachineTypeLabel = "ibm-cloud.kubernetes.io/machine-type" // UPI is the expected value assigned to machine-type label on satellite cluster nodes UPI = "upi" // VolumeIDLabel ... VolumeIDLabel = "volumeId" // VolumeCRNLabel ... VolumeCRNLabel = "volumeCRN" // ClusterIDLabel ... ClusterIDLabel = "clusterID" // IOPSLabel ... IOPSLabel = "iops" // ZoneLabel ... ZoneLabel = "zone" // ConfigFileName ... ConfigFileName = "slclient.toml" )
Variables ¶
View Source
var LockEnabled = flag.Bool("lock_enabled", true, "Enable or disable lock")
LockEnabled ...
Functions ¶
func GetContextLogger ¶
GetContextLogger ...
func GetContextLoggerWithRequestID ¶
func GetContextLoggerWithRequestID(ctx context.Context, isDebug bool, requestIDIn *string) (*zap.Logger, string)
GetContextLoggerWithRequestID adds existing requestID in the logger The Existing requestID might be coming from ControllerPublishVolume etc
func GetTestLogger ¶
GetTestLogger ...
func ListContainsSubstr ¶
ListContainsSubstr Checks if subStr is there in mainStr
func NewControllerServiceCapability ¶
func NewControllerServiceCapability(cap csi.ControllerServiceCapability_RPC_Type) *csi.ControllerServiceCapability
NewControllerServiceCapability ...
func NewNodeServiceCapability ¶
func NewNodeServiceCapability(cap csi.NodeServiceCapability_RPC_Type) *csi.NodeServiceCapability
NewNodeServiceCapability ...
func NewVolumeCapabilityAccessMode ¶
func NewVolumeCapabilityAccessMode(mode csi.VolumeCapability_AccessMode_Mode) *csi.VolumeCapability_AccessMode
NewVolumeCapabilityAccessMode ...
func RoundUpBytes ¶
RoundUpBytes rounds up the volume size in bytes upto multiplications of GiB in the unit of Bytes
Types ¶
Click to show internal directories.
Click to hide internal directories.