diff --git a/pkg/volume/awsebs/aws_ebs.go b/pkg/volume/awsebs/aws_ebs.go index 274ac79f2b1..2f6e285e84b 100644 --- a/pkg/volume/awsebs/aws_ebs.go +++ b/pkg/volume/awsebs/aws_ebs.go @@ -454,27 +454,6 @@ func makeGlobalPDPath(host volume.VolumeHost, volumeID aws.KubernetesVolumeID) s 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 { return getPath(ebs.podUID, ebs.volName, ebs.plugin.host) } diff --git a/pkg/volume/awsebs/aws_util.go b/pkg/volume/awsebs/aws_util.go index 67fe8d9cb47..8dfac881bed 100644 --- a/pkg/volume/awsebs/aws_util.go +++ b/pkg/volume/awsebs/aws_util.go @@ -39,13 +39,7 @@ import ( const ( diskPartitionSuffix = "" - diskXVDPath = "/dev/xvd" - diskXVDPattern = "/dev/xvd*" - maxChecks = 60 - maxRetries = 10 checkSleepDuration = time.Second - errorSleepDuration = 5 * time.Second - ebsMaxReplicasInAZ = 1 ) // AWSDiskUtil provides operations for EBS volume. @@ -201,20 +195,6 @@ func verifyDevicePath(devicePaths []string) (string, error) { 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 // 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