Description
Related: #230
In coder/kaniko#25 we added support for multi-stage cache probing. While testing the implementation we noticed that sometimes an instruction (e.g. RUN systemctl enable ssh
) doesn't change any files. This means the snapshotter won't create a tar archive and the cache layer won't be pushed to the remote registry.
This is problematic when running the cache probe as these instructions will not have a matching cache.
We also can't assume that a missing cache is OK because the hash of the instruction does not affect the next instruction (bug?). Essentially the instruction could be modified (RUN systemctl enable ssh
=> RUN systemctl disable ssh
) and we'd still have a cache hit if we assumed a missing cache was OK.
Potential solutions to fix the problem:
- Push empty cache layers for instructions with no-change
- Allow
md5(RUN systemctl enable ssh)
to be part of the next instructions cache key