aboutsummaryrefslogtreecommitdiff
path: root/pkg/specgen/generate/kube/volume.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/specgen/generate/kube/volume.go')
-rw-r--r--pkg/specgen/generate/kube/volume.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/specgen/generate/kube/volume.go b/pkg/specgen/generate/kube/volume.go
index 2fc63fc7c..1d6d49b9d 100644
--- a/pkg/specgen/generate/kube/volume.go
+++ b/pkg/specgen/generate/kube/volume.go
@@ -85,8 +85,8 @@ func VolumeFromHostPath(hostPath *v1.HostPathVolumeSource) (*KubeVolume, error)
if err != nil {
return nil, errors.Wrap(err, "error checking HostPathBlockDevice")
}
- if dev.Mode()&os.ModeDevice != os.ModeDevice {
- return nil, errors.Errorf("checking HosPathDevice: path %s is not a block device", hostPath.Path)
+ if dev.Mode()&os.ModeCharDevice == os.ModeCharDevice {
+ return nil, errors.Errorf("checking HostPathDevice: path %s is not a block device", hostPath.Path)
}
return &KubeVolume{
Type: KubeVolumeTypeBlockDevice,
@@ -98,7 +98,7 @@ func VolumeFromHostPath(hostPath *v1.HostPathVolumeSource) (*KubeVolume, error)
return nil, errors.Wrap(err, "error checking HostPathCharDevice")
}
if dev.Mode()&os.ModeCharDevice != os.ModeCharDevice {
- return nil, errors.Errorf("checking HosPathCharDevice: path %s is not a character device", hostPath.Path)
+ return nil, errors.Errorf("checking HostPathCharDevice: path %s is not a character device", hostPath.Path)
}
return &KubeVolume{
Type: KubeVolumeTypeCharDevice,