mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-18 15:44:40 +02:00
Add Key() to LayeredMap and Snapshotter
This will return a string representaiton of the current filesystem to be used with caching. Whenever a file is explictly added (via ADD or COPY), it will be stored in "added" in the LayeredMap. The file will map to a hash created by CacheHasher (which doesn't take into account mtime, since that will be different with every build, making the cache useless) Key() will returns a sha of the added files which will be used in determining the overall cache key for a command.
This commit is contained in:
@@ -62,7 +62,7 @@ func DoBuild(opts *options.KanikoOptions) (v1.Image, error) {
|
||||
if err := util.GetFSFromImage(constants.RootDir, sourceImage); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
l := snapshot.NewLayeredMap(hasher)
|
||||
l := snapshot.NewLayeredMap(hasher, util.CacheHasher())
|
||||
snapshotter := snapshot.NewSnapshotter(l, constants.RootDir)
|
||||
// Take initial snapshot
|
||||
if err := snapshotter.Init(); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user