Documentation
¶
Index ¶
- Constants
- Variables
- func CreateMountPoint(mountPath string) error
- func CreateObject(ctx context.Context, monitors string, cr *Credentials, ...) error
- func ExecCommand(program string, args ...string) (stdout, stderr []byte, err error)
- func GenerateVolID(ctx context.Context, monitors string, cr *Credentials, ...) (string, error)
- func GetK8sNamespace() string
- func GetMonValFromSecret(secrets map[string]string) (string, error)
- func GetOMapValue(ctx context.Context, monitors string, cr *Credentials, ...) (string, error)
- func GetPIDLimit() (int, error)
- func GetPoolID(ctx context.Context, monitors string, cr *Credentials, poolName string) (int64, error)
- func GetPoolName(ctx context.Context, monitors string, cr *Credentials, poolID int64) (string, error)
- func IsMountPoint(p string) (bool, error)
- func Log(ctx context.Context, format string) string
- func Mons(pathToConfig, clusterID string) (string, error)
- func Mount(source, target, fstype string, options []string) error
- func NewK8sClient() *k8s.Clientset
- func RemoveOMapKey(ctx context.Context, monitors string, cr *Credentials, ...) error
- func RemoveObject(ctx context.Context, monitors string, cr *Credentials, ...) error
- func RoundOffBytes(bytes int64) int64
- func RoundOffVolSize(size int64) int64
- func SetOMapKeyValue(ctx context.Context, monitors string, cr *Credentials, ...) error
- func SetPIDLimit(limit int) error
- func StartMetricsServer(c *Config)
- func StripSecretInArgs(args []string) []string
- func ValidateDriverName(driverName string) error
- func ValidateNodePublishVolumeRequest(req *csi.NodePublishVolumeRequest) error
- func ValidateNodeStageVolumeRequest(req *csi.NodeStageVolumeRequest) error
- func ValidateNodeUnpublishVolumeRequest(req *csi.NodeUnpublishVolumeRequest) error
- func ValidateNodeUnstageVolumeRequest(req *csi.NodeUnstageVolumeRequest) error
- func ValidateURL(c *Config) error
- func WriteCephConfig() error
- type CSIIdentifier
- type CSIJournal
- func (cj *CSIJournal) CheckReservation(ctx context.Context, monitors string, cr *Credentials, ...) (string, error)
- func (cj *CSIJournal) GetObjectUUIDData(ctx context.Context, monitors string, cr *Credentials, pool, objectUUID string, ...) (string, string, error)
- func (cj *CSIJournal) NamingPrefix() string
- func (cj *CSIJournal) ReserveName(ctx context.Context, monitors string, cr *Credentials, ...) (string, error)
- func (cj *CSIJournal) SetCSIDirectorySuffix(suffix string)
- func (cj *CSIJournal) SetNamespace(ns string)
- func (cj *CSIJournal) UndoReservation(ctx context.Context, monitors string, cr *Credentials, ...) error
- type CacheEntryNotFound
- type CachePersister
- type Config
- type Credentials
- type ErrKeyNotFound
- type ErrObjectExists
- type ErrObjectNotFound
- type ErrSnapNameConflict
- type ForAllFunc
- type K8sCMCache
- type NodeCache
- func (nc *NodeCache) Create(identifier string, data interface{}) error
- func (nc *NodeCache) Delete(identifier string) error
- func (nc *NodeCache) EnsureCacheDirectory(cacheDir string) error
- func (nc *NodeCache) ForAll(pattern string, destObj interface{}, f ForAllFunc) error
- func (nc *NodeCache) Get(identifier string, data interface{}) error
- type VolumeLocks
Constants ¶
const ( // VolumeOperationAlreadyExistsFmt string format to return for concerrent operation VolumeOperationAlreadyExistsFmt = "an operation with the given Volume ID %s already exists" // SnapshotOperationAlreadyExistsFmt string format to return for concerrent operation SnapshotOperationAlreadyExistsFmt = "an operation with the given Snapshot ID %s already exists" )
const ( // MiB - MebiByte size MiB = 1024 * 1024 GiB = MiB * 1024 )
remove this once kubernetes v1.14.0 release is done https://github.com/kubernetes/cloud-provider/blob/master/volume/helpers/rounding.go
const (
// CephConfigPath ceph configuration file
CephConfigPath = "/etc/ceph/ceph.conf"
)
Variables ¶
var ( // GitCommit tell the latest git commit image is built from GitCommit string // DriverVersion which will be driver version DriverVersion string )
variables which will be set during the build time
var Key = contextKey("ID")
Key for context based logging
Functions ¶
func CreateMountPoint ¶ added in v1.2.0
CreateMountPoint creates the directory with given path
func CreateObject ¶
func CreateObject(ctx context.Context, monitors string, cr *Credentials, poolName, namespace, objectName string) error
CreateObject creates the object name passed in and returns ErrObjectExists if the provided object is already present in rados
func ExecCommand ¶
ExecCommand executes passed in program with args and returns separate stdout and stderr streams
func GenerateVolID ¶
func GenerateVolID(ctx context.Context, monitors string, cr *Credentials, pool, clusterID, objUUID string, volIDVersion uint16) (string, error)
GenerateVolID generates a volume ID based on passed in parameters and version, to be returned to the CO system
func GetK8sNamespace ¶
func GetK8sNamespace() string
GetK8sNamespace returns pod namespace. if pod namespace is empty it returns default namespace
func GetOMapValue ¶
func GetOMapValue(ctx context.Context, monitors string, cr *Credentials, poolName, namespace, oMapName, oMapKey string) (string, error)
GetOMapValue gets the value for the given key from the named omap
func GetPIDLimit ¶ added in v1.2.0
GetPIDLimit returns the current PID limit, or an error. A value of -1 translates to "max".
func GetPoolID ¶
func GetPoolID(ctx context.Context, monitors string, cr *Credentials, poolName string) (int64, error)
GetPoolID searches a list of pools in a cluster and returns the ID of the pool that matches the passed in poolName parameter
func GetPoolName ¶
func GetPoolName(ctx context.Context, monitors string, cr *Credentials, poolID int64) (string, error)
GetPoolName lists all pools in a ceph cluster, and matches the pool whose pool ID is equal to the requested poolID parameter
func IsMountPoint ¶ added in v1.2.0
IsMountPoint checks if the given path is mountpoint or not
func Log ¶ added in v1.2.0
Log helps in context based logging
func Mount ¶ added in v1.2.0
Mount mounts the source to target path
func RemoveOMapKey ¶
func RemoveOMapKey(ctx context.Context, monitors string, cr *Credentials, poolName, namespace, oMapName, oMapKey string) error
RemoveOMapKey removes the omap key from the given omap name
func RemoveObject ¶
func RemoveObject(ctx context.Context, monitors string, cr *Credentials, poolName, namespace, oMapName string) error
RemoveObject removes the entire omap name passed in and returns ErrObjectNotFound is provided omap is not found in rados
func RoundOffBytes ¶ added in v1.2.2
RoundOffBytes converts roundoff the size 1.1Mib will be round off to 2Mib same for GiB size less than 1MiB will be round off to 1MiB
func RoundOffVolSize ¶ added in v1.2.2
RoundOffVolSize rounds up given quantity upto chunks of MiB/GiB
func SetOMapKeyValue ¶
func SetOMapKeyValue(ctx context.Context, monitors string, cr *Credentials, poolName, namespace, oMapName, oMapKey, keyValue string) error
SetOMapKeyValue sets the given key and value into the provided Ceph omap name