utils

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Version project
	Version = "beta"
	// CSIPluginName PluginName is the name of the CSI plugin.
	CSIPluginName = "carina.storage.io"
	// DefaultCSISocket is the default path of the CSI socket file.
	DefaultCSISocket = "/tmp/csi/csi-provisioner.sock"
	// DefaultReservedSpace Default disk space hold
	DefaultReservedSpace = 10 << 30

	// LogicVolumeNamespace logicVolume
	LogicVolumeNamespace = "default"
	// LogicVolumeFinalizer LogicalVolumeFinalizer is the name of LogicalVolume finalizer
	LogicVolumeFinalizer = "carina.storage.io/logicvolume"
	// ResizeRequestedAtKey is the key of LogicalVolume that represents the timestamp of the resize request.
	ResizeRequestedAtKey = "carina.storage.io/resize-requested-at"

	//ExclusivityDisk  true or false  is the key indicates that only the disk is used by one pod
	ExclusivityDisk = "carina.storage.io/exclusively-raw-disk"

	VolumeManagerType = "carina.io/volume-manage-type"

	// DeviceDiskKey storage class
	// DeviceDiskKey is the key used in CSI volume create requests to specify a DeviceDiskKey support carina-vg-ssd carina-vg-hdd
	DeviceDiskKey = "carina.storage.io/disk-group-name"

	VolumeBackendDiskType = "carina.storage.io/backend-disk-group-name"
	VolumeCacheDiskType   = "carina.storage.io/cache-disk-group-name"
	// VolumeCacheDiskRatio value: 1-100 Cache Capacity Ratio
	VolumeCacheDiskRatio = "carina.storage.io/cache-disk-ratio"
	// VolumeCachePolicy value: writethrough|writeback|writearound
	VolumeCachePolicy = "carina.storage.io/cache-policy"

	// MinRequestSizeGb pvc
	// default size in GiB for volumes (PVC or inline ephemeral volumes) w/o capacity requests.
	MinRequestSizeGb = 1
	// AnnSelectedNode This annotation is added to a PVC that has been triggered by scheduler to
	// be dynamically provisioned. Its value is the name of the selected node.
	AnnSelectedNode = "volume.kubernetes.io/selected-node"

	// VolumeDevicePath pv csi VolumeAttributes
	VolumeDevicePath  = "carina.storage.io/path"
	VolumeDeviceNode  = "carina.storage.io/node"
	VolumeDeviceMajor = "carina.storage.io/major"
	VolumeDeviceMinor = "carina.storage.io/minor"

	VolumeCacheDevicePath  = "carina.storage.io/cache/path"
	VolumeCacheDeviceMajor = "carina.storage.io/cache/major"
	VolumeCacheDeviceMinor = "carina.storage.io/cache/minor"
	VolumeCacheId          = "carina.storage.io/cache-volume-id"
	VolumeCacheBlock       = "carina.storage.io/cache/block"
	VolumeCacheBucket      = "carina.storage.io/cache/bucket"

	// TopologyNodeKey topology
	// TopologyZoneKey is the key of topology that represents zone name.
	TopologyNodeKey = "topology.carina.storage.io/node"

	// DeviceCapacityKeyPrefix device plugin
	DeviceCapacityKeyPrefix = "carina.storage.io/"
	// DeviceVGSSD support disk type
	DeviceVGSSD = "carina-vg-ssd"
	DeviceVGHDD = "carina-vg-hdd"

	// CarinaSchedule custom schedule
	CarinaSchedule = "carina-scheduler"

	// DeviceVolumeType type
	LvmVolumeType = "lvm"
	RawVolumeType = "raw"

	AllowPodMigrationIfNodeNotready = "carina.stroage.io/allow-pod-migration-if-node-notready"
)

Variables

This section is empty.

Functions

func ContainsString

func ContainsString(slice []string, s string) bool

func FileExists

func FileExists(path string) bool

func Fill added in v0.10.0

func Fill(src interface{}, dst interface{}) error

func MapEqualMap

func MapEqualMap(src, dst map[string]string) bool

func PartitionName added in v0.10.0

func PartitionName(lv string) string

func SliceEqualSlice

func SliceEqualSlice(src, dst []string) bool

func SliceMergeSlice

func SliceMergeSlice(src []string, dst []string) []string

func SliceRemoveString

func SliceRemoveString(slice []string, s string) (result []string)

func SliceSubSlice

func SliceSubSlice(src []string, dst []string) []string

func UntilMaxRetry

func UntilMaxRetry(f func() error, maxRetry int, interval time.Duration) error

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL