Open konturn opened 1 year ago
This would be a useful feature.
The PR doesn't addresses actions taken by the controller on such ImageCache resources + the status update for such resources.
Is there any further change to the controller logic required? It looks like the loop here already accounts for the possibility of an empty image list.
The ImageCache status is updated to Processing in below code:- https://github.com/senthilrch/kube-fledged/blob/aadfdcd2648475be4d3159122aea3c24fd7c5f36/cmd/controller/app/controller.go#L507
If the ImageCache CR has an empty image list, the CR will get stuck in the Processing status. So updating the status should be skipped when image list is empty.
A more robust solution for this use case would be to implement something on the lines of Pod scheduling gates introduced in K8s 1.26.
https://kubernetes.io/blog/2022/12/26/pod-scheduling-readiness-alpha/
Ah I see--okay, I'll go ahead and make the necessary changes to the status processing logic
My use case involves initializing an ImageCache resource out of band, and then having a separate service dynamically add and remove images from the cache. As part of this, I think it would be nice to have the option to initialize the ImageCache resource with CacheSpecs with empty Images lists.