• Jan Safranek's avatar
    Make kubelet never delete files on mounted filesystems · d7d039db
    Jan Safranek authored
    With bug #27653, kubelet could remove mounted volumes and delete user data.
    The bug itself is fixed, however our trust in kubelet is significantly lower.
    Let's add an extra version of RemoveAll that does not cross mount boundary
    (rm -rf --one-file-system).
    
    It calls lstat(path) three times for each removed directory - once in
    RemoveAllOneFilesystem and twice in IsLikelyNotMountPoint, however this way
    it's platform independent and the directory that is being removed by kubelet
    should be almost empty.
    d7d039db
removeall.go 2.61 KB