mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-20 13:38:04 +02:00
Fix caching to respect .dockerignore
Previously kaniko would compute the cache key for any copy command by computing the combined hash of all files in a directory, even if they were listed as ignored. With this change, the cache key creation was updated to be aware of ignored files. Related issues: * https://github.com/GoogleContainerTools/kaniko/issues/594
This commit is contained in:
committed by
Tejal Desai
parent
a2aae6274d
commit
123dcaf83e
@@ -213,7 +213,7 @@ func IsSrcsValid(srcsAndDest instructions.SourcesAndDest, resolvedSources []stri
|
||||
if !ContainsWildcards(srcs) {
|
||||
totalSrcs := 0
|
||||
for _, src := range srcs {
|
||||
if excludeFile(src, root) {
|
||||
if ExcludeFile(src, root) {
|
||||
continue
|
||||
}
|
||||
totalSrcs++
|
||||
@@ -250,7 +250,7 @@ func IsSrcsValid(srcsAndDest instructions.SourcesAndDest, resolvedSources []stri
|
||||
return errors.Wrap(err, "failed to get relative files")
|
||||
}
|
||||
for _, file := range files {
|
||||
if excludeFile(file, root) {
|
||||
if ExcludeFile(file, root) {
|
||||
continue
|
||||
}
|
||||
totalFiles++
|
||||
|
||||
Reference in New Issue
Block a user