Documentation
¶
Index ¶
- Constants
- Variables
- func ConvertNamespace2LVMDevicePath(namespace string, regions *model.PmemRegions) string
- func ConvertRegion2Namespace(region string) string
- func GetMetaData(resource string) (string, error)
- func IsDirEmpty(name string) (bool, error)
- func IsPart(largeList, smallList []string) bool
- func NewEventRecorder() record.EventRecorder
- func NodeFilter(configOperator metav1.LabelSelectorOperator, configKey, configValue string, ...) bool
- func Run(cmd string) (string, error)
- type LVM
- type MockLVM
- func (m *MockLVM) AddTagLV(vg, name string, tags []string) (string, error)
- func (m *MockLVM) CloneLV(src, dest string) (string, error)
- func (m *MockLVM) CreateLV(vg, name string, size uint64, mirrors uint32, tags []string) (string, error)
- func (m *MockLVM) CreateVG(name, physicalVolume string, tags []string) (string, error)
- func (m *MockLVM) EXPECT() *MockLVMMockRecorder
- func (m *MockLVM) ExtendVG(name, physicalVolume string) (string, error)
- func (m *MockLVM) ListLV(listSpec string) ([]*model.LV, error)
- func (m *MockLVM) ListPhysicalVolume() ([]*model.PV, error)
- func (m *MockLVM) ListVG() ([]*model.VG, error)
- func (m *MockLVM) RemoveLV(vg, name string) (string, error)
- func (m *MockLVM) RemoveTagLV(vg, name string, tags []string) (string, error)
- func (m *MockLVM) RemoveVG(name string) (string, error)
- type MockLVMMockRecorder
- func (mr *MockLVMMockRecorder) AddTagLV(arg1, arg2, arg3 interface{}) *gomock.Call
- func (mr *MockLVMMockRecorder) CloneLV(arg1, arg2 interface{}) *gomock.Call
- func (mr *MockLVMMockRecorder) CreateLV(arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call
- func (mr *MockLVMMockRecorder) CreateVG(arg1, arg2, arg3 interface{}) *gomock.Call
- func (mr *MockLVMMockRecorder) ExtendVG(arg1, arg2 interface{}) *gomock.Call
- func (mr *MockLVMMockRecorder) ListLV(arg1 interface{}) *gomock.Call
- func (mr *MockLVMMockRecorder) ListPhysicalVolume() *gomock.Call
- func (mr *MockLVMMockRecorder) ListVG() *gomock.Call
- func (mr *MockLVMMockRecorder) RemoveLV(arg1, arg2 interface{}) *gomock.Call
- func (mr *MockLVMMockRecorder) RemoveTagLV(arg1, arg2, arg3 interface{}) *gomock.Call
- func (mr *MockLVMMockRecorder) RemoveVG(arg1 interface{}) *gomock.Call
- type MockMounter
- func (m *MockMounter) EXPECT() *MockMounterMockRecorder
- func (m *MockMounter) EnsureFolder(target string) error
- func (m *MockMounter) FileExists(filename string) bool
- func (m *MockMounter) FormatAndMount(source, target, fstype string, mkfsOptions []string, mountOptions string) error
- func (m *MockMounter) IsMounted(target string) (bool, error)
- func (m MockMounter) SafePathRemove(targetPath string) error
- type MockMounterMockRecorder
- func (mr MockMounterMockRecorder) EnsureFolder(target interface{}) *gomock.Call
- func (mr MockMounterMockRecorder) FileExists(filename interface{}) *gomock.Call
- func (mr MockMounterMockRecorder) FormatAndMount(arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call
- func (mr MockMounterMockRecorder) IsMounted(target interface{}) *gomock.Call
- func (mr MockMounterMockRecorder) SafePathRemove(target interface{}) *gomock.Call
- type MockPmemer
- func (m *MockPmemer) CheckKMEMCreated(arg1 string) (bool, error)
- func (m *MockPmemer) CheckNamespaceUsed(arg1 string) bool
- func (m *MockPmemer) CreateNamespace(arg1, arg2 string) error
- func (m *MockPmemer) EXPECT() *MockPmemerMockRecorder
- func (m *MockPmemer) GetPmemNamespaceDeivcePath(arg1, arg2 string) (string, string, error)
- func (m *MockPmemer) GetRegions() (*model.PmemRegions, error)
- func (m *MockPmemer) MakeNamespaceMemory(arg1 string) error
- type MockPmemerMockRecorder
- func (mr *MockPmemerMockRecorder) CheckKMEMCreated(arg1 interface{}) *gomock.Call
- func (mr *MockPmemerMockRecorder) CheckNamespaceUsed(arg1 interface{}) *gomock.Call
- func (mr *MockPmemerMockRecorder) CreateNamespace(arg1, arg2 interface{}) *gomock.Call
- func (mr *MockPmemerMockRecorder) GetPmemNamespaceDeivcePath(arg1, arg2 interface{}) *gomock.Call
- func (mr *MockPmemerMockRecorder) GetRegions() *gomock.Call
- func (mr *MockPmemerMockRecorder) MakeNamespaceMemory(arg1 interface{}) *gomock.Call
- type Mounter
- type NodeLVM
- func (nl *NodeLVM) AddTagLV(vg, name string, tags []string) (string, error)
- func (nl *NodeLVM) CloneLV(src, dest string) (string, error)
- func (nl *NodeLVM) CreateLV(vg, name string, size uint64, mirrors uint32, tags []string) (string, error)
- func (nl *NodeLVM) CreateVG(name, physicalVolume string, tags []string) (string, error)
- func (nl *NodeLVM) ExtendVG(name, physicalVolume string) (string, error)
- func (nl *NodeLVM) ListLV(listSpec string) ([]*model.LV, error)
- func (nl *NodeLVM) ListPhysicalVolume() ([]*model.PV, error)
- func (nl *NodeLVM) ListVG() ([]*model.VG, error)
- func (nl *NodeLVM) RemoveLV(vg, name string) (string, error)
- func (nl *NodeLVM) RemoveTagLV(vg, name string, tags []string) (string, error)
- func (nl *NodeLVM) RemoveVG(name string) (string, error)
- type NodeMounter
- func (m *NodeMounter) EnsureFolder(target string) error
- func (m *NodeMounter) FileExists(filename string) bool
- func (m *NodeMounter) FormatAndMount(source, target, fstype string, mkfsOptions []string, mountOptions string) error
- func (m *NodeMounter) IsMounted(target string) (bool, error)
- func (m *NodeMounter) SafePathRemove(targetPath string) error
- type NodePmemer
- func (np *NodePmemer) CheckKMEMCreated(chardev string) (bool, error)
- func (np *NodePmemer) CheckNamespaceUsed(devicePath string) bool
- func (np *NodePmemer) CreateNamespace(region, pmemType string) error
- func (np *NodePmemer) GetPmemNamespaceDeivcePath(region, mode string) (devicePath string, namespaceName string, err error)
- func (np *NodePmemer) GetRegions() (*model.PmemRegions, error)
- func (np *NodePmemer) MakeNamespaceMemory(chardev string) error
- type Pmemer
Constants ¶
const ( // MetadataURL is metadata url MetadataURL = "http://100.100.100.200/latest/meta-data/" // NsenterCmd use to init resource NsenterCmd = "/usr/bin/nsenter --mount=/proc/1/ns/mnt --ipc=/proc/1/ns/ipc --net=/proc/1/ns/net --uts=/proc/1/ns/uts " // NodeResourceManager is resource manager NodeResourceManager = "node-resource-manager" )
const (
ProtectedTagName = "protected"
)
Variables ¶
var ErrParse = errors.New("Cannot parse output of blkid")
ErrParse ...
Functions ¶
func ConvertNamespace2LVMDevicePath ¶
func ConvertNamespace2LVMDevicePath(namespace string, regions *model.PmemRegions) string
ConvertNamespace2LVMDevicePath ...
func ConvertRegion2Namespace ¶
ConvertRegion2Namespace ...
func GetMetaData ¶
GetMetaData get metadata from ecs meta-server
func IsDirEmpty ¶
IsDirEmpty return status of dir empty or not
func NewEventRecorder ¶
func NewEventRecorder() record.EventRecorder
func NodeFilter ¶
func NodeFilter(configOperator metav1.LabelSelectorOperator, configKey, configValue string, nodeInfo *v1.Node) bool
NodeFilter go through all configmap to find current node config
Types ¶
type LVM ¶
type LVM interface { ListLV(listSpec string) ([]*model.LV, error) CreateLV(vg, name string, size uint64, mirrors uint32, tags []string) (string, error) RemoveLV(vg, name string) (string, error) CloneLV(src, dest string) (string, error) ListVG() ([]*model.VG, error) ListPhysicalVolume() ([]*model.PV, error) CreateVG(name, physicalVolume string, tags []string) (string, error) ExtendVG(name, physicalVolume string) (string, error) RemoveVG(name string) (string, error) AddTagLV(vg, name string, tags []string) (string, error) RemoveTagLV(vg, name string, tags []string) (string, error) }
LVM ...
type MockLVM ¶
type MockLVM struct {
// contains filtered or unexported fields
}
MockLVM ...
func (*MockLVM) CreateLV ¶
func (m *MockLVM) CreateLV(vg, name string, size uint64, mirrors uint32, tags []string) (string, error)
CreateLV ...
func (*MockLVM) ListPhysicalVolume ¶
ListPhysicalVolume ...
func (*MockLVM) RemoveTagLV ¶
RemoveTagLV ...
type MockLVMMockRecorder ¶
type MockLVMMockRecorder struct {
// contains filtered or unexported fields
}
MockLVMMockRecorder ...
func (*MockLVMMockRecorder) AddTagLV ¶
func (mr *MockLVMMockRecorder) AddTagLV(arg1, arg2, arg3 interface{}) *gomock.Call
AddTagLV ...
func (*MockLVMMockRecorder) CloneLV ¶
func (mr *MockLVMMockRecorder) CloneLV(arg1, arg2 interface{}) *gomock.Call
CloneLV ...
func (*MockLVMMockRecorder) CreateLV ¶
func (mr *MockLVMMockRecorder) CreateLV(arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call
CreateLV ...
func (*MockLVMMockRecorder) CreateVG ¶
func (mr *MockLVMMockRecorder) CreateVG(arg1, arg2, arg3 interface{}) *gomock.Call
CreateVG ...
func (*MockLVMMockRecorder) ExtendVG ¶
func (mr *MockLVMMockRecorder) ExtendVG(arg1, arg2 interface{}) *gomock.Call
ExtendVG ...
func (*MockLVMMockRecorder) ListLV ¶
func (mr *MockLVMMockRecorder) ListLV(arg1 interface{}) *gomock.Call
ListLV ...
func (*MockLVMMockRecorder) ListPhysicalVolume ¶
func (mr *MockLVMMockRecorder) ListPhysicalVolume() *gomock.Call
ListPhysicalVolume ...
func (*MockLVMMockRecorder) ListVG ¶
func (mr *MockLVMMockRecorder) ListVG() *gomock.Call
ListVG ...
func (*MockLVMMockRecorder) RemoveLV ¶
func (mr *MockLVMMockRecorder) RemoveLV(arg1, arg2 interface{}) *gomock.Call
RemoveLV ...
func (*MockLVMMockRecorder) RemoveTagLV ¶
func (mr *MockLVMMockRecorder) RemoveTagLV(arg1, arg2, arg3 interface{}) *gomock.Call
RemoveTagLV ...
func (*MockLVMMockRecorder) RemoveVG ¶
func (mr *MockLVMMockRecorder) RemoveVG(arg1 interface{}) *gomock.Call
RemoveVG ...
type MockMounter ¶
type MockMounter struct { k8smount.SafeFormatAndMount utilexec.Interface // contains filtered or unexported fields }
MockMounter ...
func (*MockMounter) EnsureFolder ¶
func (m *MockMounter) EnsureFolder(target string) error
EnsureFolder ...
func (*MockMounter) FileExists ¶
func (m *MockMounter) FileExists(filename string) bool
FileExists ...
func (*MockMounter) FormatAndMount ¶
func (m *MockMounter) FormatAndMount(source, target, fstype string, mkfsOptions []string, mountOptions string) error
FormatAndMount ...
func (*MockMounter) IsMounted ¶
func (m *MockMounter) IsMounted(target string) (bool, error)
IsMounted ...
func (MockMounter) SafePathRemove ¶
func (m MockMounter) SafePathRemove(targetPath string) error
SafePathRemove ...
type MockMounterMockRecorder ¶
type MockMounterMockRecorder struct {
// contains filtered or unexported fields
}
MockMounterMockRecorder ...
func (MockMounterMockRecorder) EnsureFolder ¶
func (mr MockMounterMockRecorder) EnsureFolder(target interface{}) *gomock.Call
EnsureFolder ...
func (MockMounterMockRecorder) FileExists ¶
func (mr MockMounterMockRecorder) FileExists(filename interface{}) *gomock.Call
EnsureFolder ...
func (MockMounterMockRecorder) FormatAndMount ¶
func (mr MockMounterMockRecorder) FormatAndMount(arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call
FormatAndMount ...
func (MockMounterMockRecorder) IsMounted ¶
func (mr MockMounterMockRecorder) IsMounted(target interface{}) *gomock.Call
IsMounted ...
func (MockMounterMockRecorder) SafePathRemove ¶
func (mr MockMounterMockRecorder) SafePathRemove(target interface{}) *gomock.Call
SafePathRemove ...
type MockPmemer ¶
type MockPmemer struct {
// contains filtered or unexported fields
}
MockPmemer ..
func (*MockPmemer) CheckKMEMCreated ¶
func (m *MockPmemer) CheckKMEMCreated(arg1 string) (bool, error)
CheckKMEMCreated ...
func (*MockPmemer) CheckNamespaceUsed ¶
func (m *MockPmemer) CheckNamespaceUsed(arg1 string) bool
CheckNamespaceUsed ...
func (*MockPmemer) CreateNamespace ¶
func (m *MockPmemer) CreateNamespace(arg1, arg2 string) error
CreateNamespace ...
func (*MockPmemer) GetPmemNamespaceDeivcePath ¶
func (m *MockPmemer) GetPmemNamespaceDeivcePath(arg1, arg2 string) (string, string, error)
GetPmemNamespaceDeivcePath ...
func (*MockPmemer) GetRegions ¶
func (m *MockPmemer) GetRegions() (*model.PmemRegions, error)
GetRegions ...
func (*MockPmemer) MakeNamespaceMemory ¶
func (m *MockPmemer) MakeNamespaceMemory(arg1 string) error
MakeNamespaceMemory ...
type MockPmemerMockRecorder ¶
type MockPmemerMockRecorder struct {
// contains filtered or unexported fields
}
MockPmemerMockRecorder ...
func (*MockPmemerMockRecorder) CheckKMEMCreated ¶
func (mr *MockPmemerMockRecorder) CheckKMEMCreated(arg1 interface{}) *gomock.Call
CheckKMEMCreated ...
func (*MockPmemerMockRecorder) CheckNamespaceUsed ¶
func (mr *MockPmemerMockRecorder) CheckNamespaceUsed(arg1 interface{}) *gomock.Call
CheckNamespaceUsed ...
func (*MockPmemerMockRecorder) CreateNamespace ¶
func (mr *MockPmemerMockRecorder) CreateNamespace(arg1, arg2 interface{}) *gomock.Call
CreateNamespace ...
func (*MockPmemerMockRecorder) GetPmemNamespaceDeivcePath ¶
func (mr *MockPmemerMockRecorder) GetPmemNamespaceDeivcePath(arg1, arg2 interface{}) *gomock.Call
GetPmemNamespaceDeivcePath ...
func (*MockPmemerMockRecorder) GetRegions ¶
func (mr *MockPmemerMockRecorder) GetRegions() *gomock.Call
GetRegions ...
func (*MockPmemerMockRecorder) MakeNamespaceMemory ¶
func (mr *MockPmemerMockRecorder) MakeNamespaceMemory(arg1 interface{}) *gomock.Call
MakeNamespaceMemory ...
type Mounter ¶
type Mounter interface { k8smount.Interface utilexec.Interface // If the folder doesn't exist, it will call 'mkdir -p' EnsureFolder(string) error // FormatAndMount ... FormatAndMount(string, string, string, []string, string) error // IsMounted checks whether the target path is a correct mount (i.e: // propagated). It returns true if it's mounted. An error is returned in // case of system errors or if it's mounted incorrectly. IsMounted(target string) (bool, error) SafePathRemove(target string) error FileExists(file string) bool }
Mounter is responsible for formatting and mounting volumes
type NodeLVM ¶
type NodeLVM struct { }
NodeLVM ...
func (*NodeLVM) CreateLV ¶
func (nl *NodeLVM) CreateLV(vg, name string, size uint64, mirrors uint32, tags []string) (string, error)
CreateLV ...
func (*NodeLVM) ListPhysicalVolume ¶
ListPhysicalVolume ...
func (*NodeLVM) RemoveTagLV ¶
RemoveTagLV ....
type NodeMounter ¶
type NodeMounter struct { k8smount.SafeFormatAndMount utilexec.Interface }
TODO(arslan): this is Linux only for now. Refactor this into a package with architecture specific code in the future, such as mounter_darwin.go, mounter_linux.go, etc..
func (*NodeMounter) EnsureFolder ¶
func (m *NodeMounter) EnsureFolder(target string) error
EnsureFolder ...
func (*NodeMounter) FileExists ¶
func (m *NodeMounter) FileExists(filename string) bool
FileExists ...
func (*NodeMounter) FormatAndMount ¶
func (m *NodeMounter) FormatAndMount(source, target, fstype string, mkfsOptions []string, mountOptions string) error
FormatAndMount ...
func (*NodeMounter) IsMounted ¶
func (m *NodeMounter) IsMounted(target string) (bool, error)
IsMounted ...
func (*NodeMounter) SafePathRemove ¶
func (m *NodeMounter) SafePathRemove(targetPath string) error
SafePathRemove ...
type NodePmemer ¶
type NodePmemer struct { }
NodePmemer ...
func (*NodePmemer) CheckKMEMCreated ¶
func (np *NodePmemer) CheckKMEMCreated(chardev string) (bool, error)
CheckKMEMCreated ...
func (*NodePmemer) CheckNamespaceUsed ¶
func (np *NodePmemer) CheckNamespaceUsed(devicePath string) bool
CheckNamespaceUsed device used in block
func (*NodePmemer) CreateNamespace ¶
func (np *NodePmemer) CreateNamespace(region, pmemType string) error
CreateNamespace ...
func (*NodePmemer) GetPmemNamespaceDeivcePath ¶
func (np *NodePmemer) GetPmemNamespaceDeivcePath(region, mode string) (devicePath string, namespaceName string, err error)
GetPmemNamespaceDeivcePath ...
func (*NodePmemer) GetRegions ¶
func (np *NodePmemer) GetRegions() (*model.PmemRegions, error)
GetRegions ...
func (*NodePmemer) MakeNamespaceMemory ¶
func (np *NodePmemer) MakeNamespaceMemory(chardev string) error
MakeNamespaceMemory ...
type Pmemer ¶
type Pmemer interface { GetRegions() (*model.PmemRegions, error) CreateNamespace(string, string) error CheckNamespaceUsed(string) bool GetPmemNamespaceDeivcePath(string, string) (string, string, error) MakeNamespaceMemory(chardev string) error CheckKMEMCreated(chardev string) (bool, error) }
Pmemer ...