Documentation ¶
Overview ¶
Copyright @ 2021 fushaosong <fushaosong@beyondlet.com>.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright @ 2021 fushaosong <fushaosong@beyondlet.com>.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- type LogicVolumeService
- func (s *LogicVolumeService) CreateVolume(ctx context.Context, namespace, pvc, node, deviceGroup, name string, ...) (string, uint32, uint32, error)
- func (s *LogicVolumeService) DeleteVolume(ctx context.Context, volumeID string) error
- func (s *LogicVolumeService) ExpandVolume(ctx context.Context, volumeID string, requestGb int64) error
- func (s *LogicVolumeService) GetLogicVolume(ctx context.Context, volumeID string) (*carinav1.LogicVolume, error)
- func (s *LogicVolumeService) UpdateLogicVolumeCurrentSize(ctx context.Context, volumeID string, size *resource.Quantity) error
- func (s *LogicVolumeService) UpdateLogicVolumeSpecSize(ctx context.Context, volumeID string, size *resource.Quantity) error
- type NodeService
- func (s NodeService) GetCapacityByNodeName(ctx context.Context, name, deviceGroup string) (int64, error)
- func (s NodeService) GetTotalCapacity(ctx context.Context, deviceGroup string, topology *csi.Topology) (int64, error)
- func (s NodeService) HaveSelectedNode(ctx context.Context, namespace, name string) (string, error)
- func (s NodeService) SelectDeviceGroup(ctx context.Context, request int64, nodeName string) (string, error)
- func (s NodeService) SelectVolumeNode(ctx context.Context, requestGb int64, deviceGroup string, ...) (string, string, map[string]string, error)
Constants ¶
This section is empty.
Variables ¶
var ErrNodeNotFound = errors.New("node not found")
ErrNodeNotFound represents the error that node is not found.
var ErrVolumeNotFound = errors.New("VolumeID is not found")
ErrVolumeNotFound represents the specified volume is not found.
Functions ¶
This section is empty.
Types ¶
type LogicVolumeService ¶
LogicVolumeService represents service for LogicVolume.
func NewLogicVolumeService ¶
func NewLogicVolumeService(mgr manager.Manager) (*LogicVolumeService, error)
NewLogicVolumeService returns LogicVolumeService.
func (*LogicVolumeService) CreateVolume ¶
func (s *LogicVolumeService) CreateVolume(ctx context.Context, namespace, pvc, node, deviceGroup, name string, requestGb int64) (string, uint32, uint32, error)
CreateVolume creates volume
func (*LogicVolumeService) DeleteVolume ¶
func (s *LogicVolumeService) DeleteVolume(ctx context.Context, volumeID string) error
DeleteVolume deletes volume
func (*LogicVolumeService) ExpandVolume ¶
func (s *LogicVolumeService) ExpandVolume(ctx context.Context, volumeID string, requestGb int64) error
ExpandVolume expands volume
func (*LogicVolumeService) GetLogicVolume ¶
func (s *LogicVolumeService) GetLogicVolume(ctx context.Context, volumeID string) (*carinav1.LogicVolume, error)
GetVolume returns LogicVolume by volume ID.
func (*LogicVolumeService) UpdateLogicVolumeCurrentSize ¶
func (s *LogicVolumeService) UpdateLogicVolumeCurrentSize(ctx context.Context, volumeID string, size *resource.Quantity) error
UpdateCurrentSize updates .Status.CurrentSize of LogicVolume.
func (*LogicVolumeService) UpdateLogicVolumeSpecSize ¶
func (s *LogicVolumeService) UpdateLogicVolumeSpecSize(ctx context.Context, volumeID string, size *resource.Quantity) error
UpdateSpecSize updates .Spec.Size of LogicVolume.
type NodeService ¶
NodeService represents node service.
func NewNodeService ¶
func NewNodeService(mgr manager.Manager) *NodeService
NewNodeService returns NodeService.
func (NodeService) GetCapacityByNodeName ¶
func (s NodeService) GetCapacityByNodeName(ctx context.Context, name, deviceGroup string) (int64, error)
GetCapacityByNodeName returns VG capacity of specified node by name.
func (NodeService) GetTotalCapacity ¶
func (s NodeService) GetTotalCapacity(ctx context.Context, deviceGroup string, topology *csi.Topology) (int64, error)
GetTotalCapacity returns total VG capacity of all nodes.