the ensureDirectory seems to be just a wrapper around MkdirAll.
Since MkdirAll doesn't treat an existing directory as an error, there is no need of the extra stat() syscall that was previously performed.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
More and more components checkpoints (i.e., persist their states) in
kubelet. Refurbish and move the implementation in dockershim to a
utility package to improve code reusability.