hyperhq / runv

Hypervisor-based Runtime for OCI
Apache License 2.0
828 stars 129 forks source link

reorder createContainer steps #557

Closed bergwolf closed 7 years ago

bergwolf commented 7 years ago

defer functions are called in stack order. Move state dir preparation first so that it is cleaned up last. Otherwise we might accidentally delete contents in container rootfs in case of failure.

This should fix https://github.com/hyperhq/runv/issues/550.

bergwolf commented 7 years ago

os.RemoveAll() does not follow symlinks!