Documentation ¶
Index ¶
- Constants
- Variables
- func AddTagLV(ctx context.Context, vg string, name string, tags []string) (string, error)
- func CleanPath(ctx context.Context, path string) error
- func CloneLV(ctx context.Context, src, dest string) (string, error)
- func ConvertString2int(origin string) string
- func CreateLV(ctx context.Context, vg string, name string, size uint64, mirrors uint32, ...) (string, error)
- func CreateLoopDevice(templateFile, pvName, quotaSize string, lp manager.LoopDevice) (string, error)
- func CreateNameSpace(ctx context.Context, region string, name string, size uint64) (string, error)
- func CreateProjQuotaSubpath(ctx context.Context, subPath, quotaSize, rootPath string) (string, string, string, error)
- func CreateVG(ctx context.Context, name string, physicalVolume string, tags []string) (string, error)
- func DeleteLoopDevice(pvName string) error
- func GetLvmdPort() string
- func GetNameSpace(namespaceName string) (*lib.NameSpace, error)
- func GetNamespaceAssignedQuota(namespace string) (int, error)
- func ListLV(listspec string) ([]*lib.LV, error)
- func ListNameSpace() ([]*lib.NameSpace, error)
- func ListVG() ([]*lib.VG, error)
- func RemoveLV(ctx context.Context, vg string, name string) (string, error)
- func RemoveNameSpace(ctx context.Context, namespaceName string) (string, error)
- func RemoveProjQuotaSubpath(ctx context.Context, quotaSubpath string) (string, error)
- func RemoveTagLV(ctx context.Context, vg string, name string, tags []string) (string, error)
- func RemoveVG(ctx context.Context, name string) (string, error)
- func SafeRemoveLV(ctx context.Context, vg, name string) (string, error)
- func SelectNamespace(ctx context.Context, quotaSize string) (string, error)
- func SetProjectID2PVSubpath(subPath, fullPath, rootPath, filesystem string, run utils.CommandRunFunc) (string, error)
- func SetSubpathProjQuota(ctx context.Context, projQuotaSubpath, blockHardlimit, blockSoftlimit string) (string, error)
- func Start(kubeClient *kubernetes.Clientset, ch chan bool, templateFile string)
- type LoopDeviceServer
- type ProjQuotaServer
- func (s ProjQuotaServer) CreateProjQuotaSubpath(ctx context.Context, in *lib.CreateProjQuotaSubpathRequest) (*lib.CreateProjQuotaSubpathReply, error)
- func (s ProjQuotaServer) RemoveProjQuotaSubpath(ctx context.Context, in *lib.RemoveProjQuotaSubpathRequest) (*lib.RemoveProjQuotaSubpathReply, error)
- func (s ProjQuotaServer) SetSubpathProjQuota(ctx context.Context, in *lib.SetSubpathProjQuotaRequest) (*lib.SetSubpathProjQuotaReply, error)
- type Server
- func (s Server) AddTagLV(ctx context.Context, in *lib.AddTagLVRequest) (*lib.AddTagLVReply, error)
- func (s Server) CleanPath(ctx context.Context, in *lib.CleanPathRequest) (*lib.CleanPathReply, error)
- func (s Server) CloneLV(ctx context.Context, in *lib.CloneLVRequest) (*lib.CloneLVReply, error)
- func (s Server) CreateLV(ctx context.Context, in *lib.CreateLVRequest) (*lib.CreateLVReply, error)
- func (s Server) CreateNamespace(ctx context.Context, in *lib.CreateNamespaceRequest) (*lib.CreateNamespaceReply, error)
- func (s Server) CreateVG(ctx context.Context, in *lib.CreateVGRequest) (*lib.CreateVGReply, error)
- func (s Server) ListLV(ctx context.Context, in *lib.ListLVRequest) (*lib.ListLVReply, error)
- func (s Server) ListNamespace(ctx context.Context, in *lib.ListNamespaceRequest) (*lib.ListNamespaceReply, error)
- func (s Server) ListVG(ctx context.Context, in *lib.ListVGRequest) (*lib.ListVGReply, error)
- func (s Server) RemoveLV(ctx context.Context, in *lib.RemoveLVRequest) (*lib.RemoveLVReply, error)
- func (s Server) RemoveNamespace(ctx context.Context, in *lib.RemoveNamespaceRequest) (*lib.RemoveNamespaceReply, error)
- func (s Server) RemoveTagLV(ctx context.Context, in *lib.RemoveTagLVRequest) (*lib.RemoveTagLVReply, error)
- func (s Server) RemoveVG(ctx context.Context, in *lib.CreateVGRequest) (*lib.RemoveVGReply, error)
Constants ¶
const ( // NsenterCmd is the nsenter command NsenterCmd = "/nsenter --mount=/proc/1/ns/mnt --ipc=/proc/1/ns/ipc --net=/proc/1/ns/net --uts=/proc/1/ns/uts " // ProjQuotaPrefix is the template of quota fullpath ProjQuotaPrefix = "/mnt/quotapath.%s/%s" // ProjQuotaNamespacePrefix ... ProjQuotaNamespacePrefix = "/mnt/quotapath.%s" )
const (
// LvmdPort is lvm daemon tcp port
LvmdPort = "1736"
)
const ProtectedTagName = "protected"
ProtectedTagName is a tag that prevents RemoveLV & RemoveVG from removing a volume
Variables ¶
var KubeClient = &kubernetes.Clientset{}
KubeClient for resource access
Functions ¶
func ConvertString2int ¶ added in v1.1.1
ConvertString2int convert pvName to int data
func CreateLV ¶ added in v1.1.0
func CreateLV(ctx context.Context, vg string, name string, size uint64, mirrors uint32, tags []string, striping bool) (string, error)
CreateLV creates a new volume
func CreateLoopDevice ¶ added in v1.1.7
func CreateLoopDevice(templateFile, pvName, quotaSize string, lp manager.LoopDevice) (string, error)
func CreateNameSpace ¶ added in v1.1.0
CreateNameSpace creates a new namespace ndctl create-namespace -r region0 --size=6G -n webpmem1
func CreateProjQuotaSubpath ¶ added in v1.1.1
func CreateProjQuotaSubpath(ctx context.Context, subPath, quotaSize, rootPath string) (string, string, string, error)
CreateProjQuotaSubpath ...
func CreateVG ¶ added in v1.1.0
func CreateVG(ctx context.Context, name string, physicalVolume string, tags []string) (string, error)
CreateVG create volume group
func DeleteLoopDevice ¶ added in v1.1.7
func GetNameSpace ¶ added in v1.1.0
GetNameSpace get pmem namespace
func GetNamespaceAssignedQuota ¶ added in v1.1.1
GetNamespaceAssignedQuota ...
func ListNameSpace ¶ added in v1.1.0
ListNameSpace list pmem namespace
func RemoveNameSpace ¶ added in v1.1.0
RemoveNameSpace removes a namespace
func RemoveProjQuotaSubpath ¶ added in v1.1.1
RemoveProjQuotaSubpath ...
func RemoveTagLV ¶ added in v1.1.0
RemoveTagLV remove tag
func SafeRemoveLV ¶ added in v1.2.0
SafeRemoveLV removes an LV without utilizing the "-f" option. As a result, if the LV is currently mounted, an error will be prompted.
func SelectNamespace ¶ added in v1.1.1
SelectNamespace ...
func SetProjectID2PVSubpath ¶ added in v1.1.1
func SetProjectID2PVSubpath(subPath, fullPath, rootPath, filesystem string, run utils.CommandRunFunc) (string, error)
SetProjectID2PVSubpath ...
Types ¶
type LoopDeviceServer ¶ added in v1.1.7
type LoopDeviceServer struct {
// contains filtered or unexported fields
}
func NewLoopDeviceServer ¶ added in v1.1.7
func NewLoopDeviceServer(tf string) LoopDeviceServer
NewLoopDeviceServer create new loop device server
func (LoopDeviceServer) CreateLoopDevice ¶ added in v1.1.7
func (lds LoopDeviceServer) CreateLoopDevice(ctx context.Context, in *lib.CreateLoopDeviceRequest) (*lib.CreateLoopDeviceReply, error)
CreateLoopDevice defines how to create loopdevice by pv
func (LoopDeviceServer) DeleteLoopDevice ¶ added in v1.1.7
func (lds LoopDeviceServer) DeleteLoopDevice(ctx context.Context, in *lib.DeleteLoopDeviceRequest) (*lib.DeleteLoopDeviceReply, error)
type ProjQuotaServer ¶ added in v1.1.1
type ProjQuotaServer struct{}
ProjQuotaServer proj quota grpc server
func NewProjQuotaServer ¶ added in v1.1.1
func NewProjQuotaServer() ProjQuotaServer
NewProjQuotaServer new proj quota grpc server
func (ProjQuotaServer) CreateProjQuotaSubpath ¶ added in v1.1.1
func (s ProjQuotaServer) CreateProjQuotaSubpath(ctx context.Context, in *lib.CreateProjQuotaSubpathRequest) (*lib.CreateProjQuotaSubpathReply, error)
CreateProjQuotaSubpath ...
func (ProjQuotaServer) RemoveProjQuotaSubpath ¶ added in v1.1.1
func (s ProjQuotaServer) RemoveProjQuotaSubpath(ctx context.Context, in *lib.RemoveProjQuotaSubpathRequest) (*lib.RemoveProjQuotaSubpathReply, error)
RemoveProjQuotaSubpath ...
func (ProjQuotaServer) SetSubpathProjQuota ¶ added in v1.1.1
func (s ProjQuotaServer) SetSubpathProjQuota(ctx context.Context, in *lib.SetSubpathProjQuotaRequest) (*lib.SetSubpathProjQuotaReply, error)
SetSubpathProjQuota ...
type Server ¶
type Server struct{}
Server lvm grpc server
func (Server) AddTagLV ¶
func (s Server) AddTagLV(ctx context.Context, in *lib.AddTagLVRequest) (*lib.AddTagLVReply, error)
AddTagLV add tag
func (Server) CleanPath ¶
func (s Server) CleanPath(ctx context.Context, in *lib.CleanPathRequest) (*lib.CleanPathReply, error)
CleanPath remove file under path
func (Server) CloneLV ¶
func (s Server) CloneLV(ctx context.Context, in *lib.CloneLVRequest) (*lib.CloneLVReply, error)
CloneLV clone lvm volume
func (Server) CreateLV ¶
func (s Server) CreateLV(ctx context.Context, in *lib.CreateLVRequest) (*lib.CreateLVReply, error)
CreateLV create lvm volume
func (Server) CreateNamespace ¶ added in v1.1.1
func (s Server) CreateNamespace(ctx context.Context, in *lib.CreateNamespaceRequest) (*lib.CreateNamespaceReply, error)
CreateNamespace create pmem namespace
func (Server) CreateVG ¶
func (s Server) CreateVG(ctx context.Context, in *lib.CreateVGRequest) (*lib.CreateVGReply, error)
CreateVG create volume group
func (Server) ListLV ¶
func (s Server) ListLV(ctx context.Context, in *lib.ListLVRequest) (*lib.ListLVReply, error)
ListLV list lvm volume
func (Server) ListNamespace ¶ added in v1.1.1
func (s Server) ListNamespace(ctx context.Context, in *lib.ListNamespaceRequest) (*lib.ListNamespaceReply, error)
ListNamespace list pmem namespace
func (Server) ListVG ¶
func (s Server) ListVG(ctx context.Context, in *lib.ListVGRequest) (*lib.ListVGReply, error)
ListVG list volume group
func (Server) RemoveLV ¶
func (s Server) RemoveLV(ctx context.Context, in *lib.RemoveLVRequest) (*lib.RemoveLVReply, error)
RemoveLV remove lvm volume
func (Server) RemoveNamespace ¶ added in v1.1.1
func (s Server) RemoveNamespace(ctx context.Context, in *lib.RemoveNamespaceRequest) (*lib.RemoveNamespaceReply, error)
RemoveNamespace remove pmem namespace
func (Server) RemoveTagLV ¶
func (s Server) RemoveTagLV(ctx context.Context, in *lib.RemoveTagLVRequest) (*lib.RemoveTagLVReply, error)
RemoveTagLV remove tag
func (Server) RemoveVG ¶
func (s Server) RemoveVG(ctx context.Context, in *lib.CreateVGRequest) (*lib.RemoveVGReply, error)
RemoveVG remove volume group