We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d3d870f + 033f94e commit cdc9e33Copy full SHA for cdc9e33
staging/src/k8s.io/legacy-cloud-providers/aws/aws.go
@@ -1884,12 +1884,8 @@ func (c *Cloud) getMountDevice(
1884
volumeStatus := map[EBSVolumeID]string{} // for better logging of volume status
1885
for _, blockDevice := range info.BlockDeviceMappings {
1886
name := aws.StringValue(blockDevice.DeviceName)
1887
- if strings.HasPrefix(name, "/dev/sd") {
1888
- name = name[7:]
1889
- }
1890
- if strings.HasPrefix(name, "/dev/xvd") {
1891
- name = name[8:]
1892
+ name = strings.TrimPrefix(name, "/dev/sd")
+ name = strings.TrimPrefix(name, "/dev/xvd")
1893
if len(name) < 1 || len(name) > 2 {
1894
klog.Warningf("Unexpected EBS DeviceName: %q", aws.StringValue(blockDevice.DeviceName))
1895
}
0 commit comments