Documentation ¶
Overview ¶
Copyright 2022 The Kubernetes Authors.
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 ¶
- func Attach(ctx context.Context, c *Connector, io ioHandler) (string, error)
- func Detach(ctx context.Context, devicePath string, io ioHandler) error
- func FindDiskById(logger klog.Logger, wwn string, io ioHandler) (string, []string)
- func FindLinkedDevicesOnMultipath(logger klog.Logger, dm string, io ioHandler) []string
- func ResizeMultipathDevice(ctx context.Context, devicePath string) error
- type Connector
- type OSioHandler
- func (handler *OSioHandler) EvalSymlinks(path string) (string, error)
- func (handler *OSioHandler) Lstat(name string) (os.FileInfo, error)
- func (handler *OSioHandler) ReadDir(dirname string) ([]os.FileInfo, error)
- func (handler *OSioHandler) WriteFile(filename string, data []byte, perm os.FileMode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindDiskById ¶ added in v1.0.2
FindDiskById: given a wwn of the storage volume, find the multipath device and associated scsi devices
func FindLinkedDevicesOnMultipath ¶ added in v1.0.0
FindLinkedDevicesOnMultipath: returns all slaves on the multipath device given the device path
Types ¶
type Connector ¶
type Connector struct { VolumeName string `json:"volume_name"` // Passed In: A name given to the storage volume by the provisioner, for debugging. VolumeWWN string `json:"volume_wwn"` // Passed In: 128 bit world wide name given to storage volume. Multipath bool `json:"multipath"` // Discovered: True indicates that OSPathName is a multipath device (dm-#), otherwise it is a regular device (/dev/sdX) OSPathName string `json:"os_device_path"` // Discovered: The OS path to the storage volume WWN, for example /dev/sdb or /dev/dm-5 OSDevicePaths []string `json:"scsi_devices"` // Discovered: The OS path(s) to the storage volume WWN, for example ["/dev/sdb"] or ["/dev/sdb", "/dev/sdc"] IoHandler ioHandler // Passed In }
Connector provides a struct to hold all of the needed parameters to make our SAS connection
func GetConnectorFromFile ¶
GetConnectorFromFile attempts to create a Connector using the specified json file (ie /var/lib/pfile/myConnector.json)
type OSioHandler ¶
type OSioHandler struct{}
OSioHandler is a wrapper that includes all the necessary io functions used for (Should be used as default io handler)
func (*OSioHandler) EvalSymlinks ¶
func (handler *OSioHandler) EvalSymlinks(path string) (string, error)
EvalSymlinks calls EvalSymlinks from filepath package
func (*OSioHandler) Lstat ¶
func (handler *OSioHandler) Lstat(name string) (os.FileInfo, error)
Lstat calls the Lstat function from os package