open-horizon / anax

Horizon agent control system
https://open-horizon.github.io/docs/anax/docs/
Apache License 2.0
70 stars 99 forks source link

Bug: agent-uninstall.sh stucked when deleting the agent deployment #4043

Open LiilyZhang opened 2 months ago

LiilyZhang commented 2 months ago

The agent-uninstall.sh occasionally stucks during deleting agent deployment:

2024-04-22 11:48:48 INFO: Deleting agent deployment...
Error from server (NotFound): deployments.apps "agent" not found
2024-04-22 11:49:00 INFO: Checking if agent pods are deleted
2024-04-22 11:49:01 INFO: Agent pods are not deleted by deleting deployment, delete pods now
pod "auto-upgrade-cronjob-28563527-6sl65" deleted
pod "auto-upgrade-cronjob-28563529-95mz5" deleted
2024-04-22 11:49:54 INFO: Agent pods still exist
....

This is because the cronjob has not been deleted when checking the agent pod existence. The cronjob pod is up every 15s. Need to change the deletion order to prevent this