Related issue
https://github.com/longhorn/longhorn/issues/2513
Steps
- Make sure the setting
Allow Recurring Job While Volume Is Detached
isdisabled
- Create a volume. Attach to a node. Create a recurring backup job that run every minute.
- Wait for the cronjob to be scheduled a few times.
- Detach the volume.
- Verify that the CronJob get deleted.
- Wait 2 hours (> 100 mins).
- Attach the volume to a node.
- Verify that the CronJob get created.
- Verify that Kubernetes schedules a run for the CronJob at the beginning of the next minute.
- Make sure the setting
Allow Recurring Job While Volume Is Detached
isenabled
. - Detach the volume.
- Verify that the CronJob is not deleted.
- Wait for Kubernetes to schedule a run for the CronJob at the beginning of the next minute. Verify that the volume is attached, CronJob runs, then volume is detached.