Description
Any steps that modify the underlying instance/VM in WICD cleanup should occur before WICD cleanup applies the reboot annotation. Otherwise WMCO's node controller might reboot the instance before the other cleanup steps finish.
Engineering Details
cleanupContainers() should be moved to occur earlier in WICD cleanup, as it is an on-instance operation. Also at minimum, a comment should be added in code calling out this ordering requirement.
Acceptance Criteria
All cleanup steps that modify the instance occur before the reboot annotation is applied. Removing version annotation should remain the last step in WICD cleanup.
QE: Test case should be that no timing errors occur when deconfiguring nodes that have many running containers, specifically containers that cannot be drained from the node (i.e. DaemonSet managed workloads).