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 APIKeyImpl
- type ClusterInfo
- type LockStore
Constants ¶
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 )
const ( // KB ... KB = 1 << (10 * iota) // MB ... MB // GB ... GB // TB ... TB )
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" // NodeWorkerIDLabel worker ID label attached to node NodeWorkerIDLabel = "ibm-cloud.kubernetes.io/worker-id" // NodeInstanceIDLabel VPC ID label attached to satellite host NodeInstanceIDLabel = "ibm-cloud.kubernetes.io/vpc-instance-id" // VolumeIDLabel ... VolumeIDLabel = "volumeId" // VolumeCRNLabel ... VolumeCRNLabel = "volumeCRN" // ClusterIDLabel ... ClusterIDLabel = "clusterID" // IOPSLabel ... IOPSLabel = "iops" // ZoneLabel ... ZoneLabel = "zone" // ConfigFileName ... ConfigFileName = "slclient.toml" )
Variables ¶
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 ¶
type APIKeyImpl ¶
type APIKeyImpl struct { GRPCBackend grpcClient.GrpcSessionFactory // contains filtered or unexported fields }
APIKeyImpl implementation
func NewAPIKeyImpl ¶
func NewAPIKeyImpl(loggerIn *zap.Logger) (*APIKeyImpl, error)
NewAPIKeyImpl returns the new decryptor
func (*APIKeyImpl) UpdateIAMKeys ¶
func (d *APIKeyImpl) UpdateIAMKeys(config *config.Config) error
UpdateIAMKeys decrypts the API keys and updates.
type ClusterInfo ¶
type ClusterInfo struct { ClusterID string `json:"cluster_id"` ClusterName string `json:"cluster_name,omitempty"` DataCenter string `json:"datacenter,omitempty"` CustomerID string `json:"customer_id,omitempty"` }
ClusterInfo contains the cluster information
func NewClusterInfo ¶
func NewClusterInfo(logger *zap.Logger) (*ClusterInfo, error)
NewClusterInfo loads cluster info