• Kubernetes Submit Queue's avatar
    Merge pull request #31515 from jsafrane/format-error · a4269040
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue (batch tested with PRs 41714, 41510, 42052, 41918, 31515)
    
    Show specific error when a volume is formatted by unexpected filesystem.
    
    kubelet now detects that e.g. xfs volume is being mounted as ext3 because of
    wrong volume.Spec.
    
    Mount error is left in the error message to diagnose issues with mounting e.g.
    'ext3' volume as 'ext4' - they are different filesystems, however kernel should
    mount ext3 as ext4 without errors.
    
    Example kubectl describe pod output:
    
    ```
      FirstSeen     LastSeen        Count   From                                    SubobjectPath   Type            Reason          Message
      41s           3s              7       {kubelet ip-172-18-3-82.ec2.internal}                   Warning         FailedMount     MountVolume.MountDevice failed for volume "kubernetes.io/aws-ebs/aws://us-east-1d/vol-ba79c81d" (spec.Name: "pvc-ce175cbb-6b82-11e6-9fe4-0e885cca73d3") pod "3d19cb64-6b83-11e6-9fe4-0e885cca73d3" (UID: "3d19cb64-6b83-11e6-9fe4-0e885cca73d3") with: failed to mount the volume as "ext4", it's already formatted with "xfs". Mount error: mount failed: exit status 32
    Mounting arguments: /dev/xvdba /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-east-1d/vol-ba79c81d ext4 [defaults]
    Output: mount: wrong fs type, bad option, bad superblock on /dev/xvdba,
           missing codepage or helper program, or other error
    
           In some cases useful info is found in syslog - try
           dmesg | tail or so.
    ```
    a4269040
Name
Last commit
Last update
..
BUILD Loading commit data...
OWNERS Loading commit data...
doc.go Loading commit data...
fake.go Loading commit data...
mount.go Loading commit data...
mount_linux.go Loading commit data...
mount_linux_test.go Loading commit data...
mount_unsupported.go Loading commit data...
nsenter_mount.go Loading commit data...
nsenter_mount_unsupported.go Loading commit data...
safe_format_and_mount_test.go Loading commit data...