What I do:
- Create a CISM telling kuik to mirror all my images to a private registry.
- After a few seconds, change my mind, and delete that CISM.
What I expect to see:
kuik starts to mirror images, but as soon as I delete the CISM, it should stop.
What I see instead:
kuik tries to mirror all my images at least once. It continues to mirror images even after the CISM is deleted. And then, after it has mirrored (or tried to mirror) all the images, it deletes them all (since the CISM was deleted).
Suggestions:
I didn't look at the code, but I suppose that the controller's reconciliation loop tries to mirror all images each time it's invoked. Instead, it could mirror one image, then requeue the CISM. So at each invocation (each time the CISM gets passed to the reconciliation loop) it will process one more image from the CISM, and if the CISM is deleted, it will stop immediately after the image that it's currently processing.
What I do:
What I expect to see:
kuik starts to mirror images, but as soon as I delete the CISM, it should stop.
What I see instead:
kuik tries to mirror all my images at least once. It continues to mirror images even after the CISM is deleted. And then, after it has mirrored (or tried to mirror) all the images, it deletes them all (since the CISM was deleted).
Suggestions:
I didn't look at the code, but I suppose that the controller's reconciliation loop tries to mirror all images each time it's invoked. Instead, it could mirror one image, then requeue the CISM. So at each invocation (each time the CISM gets passed to the reconciliation loop) it will process one more image from the CISM, and if the CISM is deleted, it will stop immediately after the image that it's currently processing.