mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #90337 from gaurav1086/aws_use_TrimPrefix
[Provider/aws] use strings.TrimPrefix()
This commit is contained in:
commit
cdc9e337d2
@ -1884,12 +1884,8 @@ func (c *Cloud) getMountDevice(
|
||||
volumeStatus := map[EBSVolumeID]string{} // for better logging of volume status
|
||||
for _, blockDevice := range info.BlockDeviceMappings {
|
||||
name := aws.StringValue(blockDevice.DeviceName)
|
||||
if strings.HasPrefix(name, "/dev/sd") {
|
||||
name = name[7:]
|
||||
}
|
||||
if strings.HasPrefix(name, "/dev/xvd") {
|
||||
name = name[8:]
|
||||
}
|
||||
name = strings.TrimPrefix(name, "/dev/sd")
|
||||
name = strings.TrimPrefix(name, "/dev/xvd")
|
||||
if len(name) < 1 || len(name) > 2 {
|
||||
klog.Warningf("Unexpected EBS DeviceName: %q", aws.StringValue(blockDevice.DeviceName))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user