mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
delete some unused code for awsebs
Signed-off-by: PingWang <wang.ping5@zte.com.cn>
This commit is contained in:
parent
7e02769736
commit
64c84aa610
@ -454,27 +454,6 @@ func makeGlobalPDPath(host volume.VolumeHost, volumeID aws.KubernetesVolumeID) s
|
|||||||
return filepath.Join(host.GetPluginDir(awsElasticBlockStorePluginName), mount.MountsInGlobalPDPath, name)
|
return filepath.Join(host.GetPluginDir(awsElasticBlockStorePluginName), mount.MountsInGlobalPDPath, name)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reverses the mapping done in makeGlobalPDPath
|
|
||||||
func getVolumeIDFromGlobalMount(host volume.VolumeHost, globalPath string) (string, error) {
|
|
||||||
basePath := filepath.Join(host.GetPluginDir(awsElasticBlockStorePluginName), mount.MountsInGlobalPDPath)
|
|
||||||
rel, err := filepath.Rel(basePath, globalPath)
|
|
||||||
if err != nil {
|
|
||||||
klog.Errorf("Failed to get volume id from global mount %s - %v", globalPath, err)
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
if strings.Contains(rel, "../") {
|
|
||||||
klog.Errorf("Unexpected mount path: %s", globalPath)
|
|
||||||
return "", fmt.Errorf("unexpected mount path: " + globalPath)
|
|
||||||
}
|
|
||||||
// Reverse the :// replacement done in makeGlobalPDPath
|
|
||||||
volumeID := rel
|
|
||||||
if strings.HasPrefix(volumeID, "aws/") {
|
|
||||||
volumeID = strings.Replace(volumeID, "aws/", "aws://", 1)
|
|
||||||
}
|
|
||||||
klog.V(2).Info("Mapping mount dir ", globalPath, " to volumeID ", volumeID)
|
|
||||||
return volumeID, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (ebs *awsElasticBlockStore) GetPath() string {
|
func (ebs *awsElasticBlockStore) GetPath() string {
|
||||||
return getPath(ebs.podUID, ebs.volName, ebs.plugin.host)
|
return getPath(ebs.podUID, ebs.volName, ebs.plugin.host)
|
||||||
}
|
}
|
||||||
|
@ -39,13 +39,7 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
diskPartitionSuffix = ""
|
diskPartitionSuffix = ""
|
||||||
diskXVDPath = "/dev/xvd"
|
|
||||||
diskXVDPattern = "/dev/xvd*"
|
|
||||||
maxChecks = 60
|
|
||||||
maxRetries = 10
|
|
||||||
checkSleepDuration = time.Second
|
checkSleepDuration = time.Second
|
||||||
errorSleepDuration = 5 * time.Second
|
|
||||||
ebsMaxReplicasInAZ = 1
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// AWSDiskUtil provides operations for EBS volume.
|
// AWSDiskUtil provides operations for EBS volume.
|
||||||
@ -201,20 +195,6 @@ func verifyDevicePath(devicePaths []string) (string, error) {
|
|||||||
return "", nil
|
return "", nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the first path that exists, or empty string if none exist.
|
|
||||||
func verifyAllPathsRemoved(devicePaths []string) (bool, error) {
|
|
||||||
allPathsRemoved := true
|
|
||||||
for _, path := range devicePaths {
|
|
||||||
exists, err := mount.PathExists(path)
|
|
||||||
if err != nil {
|
|
||||||
return false, fmt.Errorf("Error checking if path exists: %v", err)
|
|
||||||
}
|
|
||||||
allPathsRemoved = allPathsRemoved && !exists
|
|
||||||
}
|
|
||||||
|
|
||||||
return allPathsRemoved, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Returns list of all paths for given EBS mount
|
// Returns list of all paths for given EBS mount
|
||||||
// This is more interesting on GCE (where we are able to identify volumes under /dev/disk-by-id)
|
// This is more interesting on GCE (where we are able to identify volumes under /dev/disk-by-id)
|
||||||
// Here it is mostly about applying the partition path
|
// Here it is mostly about applying the partition path
|
||||||
|
Loading…
Reference in New Issue
Block a user