Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow image list to be empty #210

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

konturn
Copy link

@konturn konturn commented Mar 31, 2023

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.

@senthilrch
Copy link
Owner

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.

@konturn
Copy link
Author

konturn commented Apr 3, 2023

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.

@senthilrch
Copy link
Owner

The ImageCache status is updated to Processing in below code:-

if err = c.updateImageCacheStatus(imageCache, status); err != nil {

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.

@senthilrch
Copy link
Owner

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/

@konturn
Copy link
Author

konturn commented Apr 4, 2023

Ah I see--okay, I'll go ahead and make the necessary changes to the status processing logic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants