Skip to content

Commit

Permalink
Merge pull request #127 from jingxu97/apr/format
Browse files Browse the repository at this point in the history
Fix IsVolumeFormatted issue on checking volume type "Unknown"
  • Loading branch information
k8s-ci-robot authored May 9, 2021
2 parents 41e1a53 + 60960cc commit f010bac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/os/volume/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ func (VolAPIImplementor) IsVolumeFormatted(volumeID string) (bool, error) {
if err != nil {
return false, fmt.Errorf("error checking if volume is formatted. cmd: %s, output: %s, error: %v", cmd, string(out), err)
}
if len(strings.TrimSpace(string(out))) == 0 {
stringOut := strings.TrimSpace(string(out))
if len(stringOut) == 0 || strings.EqualFold(stringOut, "Unknown") {
return false, nil
}
return true, nil
Expand Down

0 comments on commit f010bac

Please sign in to comment.