Open cvgw opened 4 years ago
Hitting a side-effect of this issue as well, since the pulled images never seem to be cleaned up the folder used for the cache will eventually fill up causing the prewarmer to fail pulling new images. It would have been nice if the prewarmer removed images that are older than the TTL
Actual behavior Cache warmer does not return an error and does not remove expired images from the cache. The function used to check for the presence of a cached image takes options containing the value of
cache-ttl
. This function does not return an error when the cached image is found but expired. https://github.com/GoogleContainerTools/kaniko/blob/9ebee24bf332e89817844125de1225ba0247b573/pkg/cache/cache.go#L135and the warmer code does not check if the return image is nil
https://github.com/GoogleContainerTools/kaniko/blob/9ebee24bf332e89817844125de1225ba0247b573/pkg/cache/warm.go#L56
Expected behavior Either the cache warmer does not accept the
cache-ttl
flag OR The cache warmer re-downloads an image to the cache when it is expired OR The cache warmer deletes an image from the cache when it is expired OR The cache warmer exits with an error code when an image is expiredTo Reproduce Steps to reproduce the behavior: If the base image was not present, the file will be written to the cache and the cache warmer will output some traces:
If the base image was already in the cache and is not expired according to the --cache-ttl option, nothing special happens beside a specific trace:
If it's expired, nothing special happens but the trace is different:
Additional Information
Kaniko Image (fully qualified with digest)
Triage Notes for the Maintainers
--cache
flag