mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-22 06:37:14 +02:00
Merge pull request #854 from WanzenBug/ignored-files-invalidate-cache
Fix caching to respect .dockerignore
This commit is contained in:
+5
-5
@@ -547,7 +547,7 @@ func CopyDir(src, dest, buildcontext string) ([]string, error) {
|
||||
fmt.Println(" i am returning from here this", err)
|
||||
return nil, err
|
||||
}
|
||||
if excludeFile(fullPath, buildcontext) {
|
||||
if ExcludeFile(fullPath, buildcontext) {
|
||||
logrus.Debugf("%s found in .dockerignore, ignoring", src)
|
||||
continue
|
||||
}
|
||||
@@ -580,7 +580,7 @@ func CopyDir(src, dest, buildcontext string) ([]string, error) {
|
||||
|
||||
// CopySymlink copies the symlink at src to dest
|
||||
func CopySymlink(src, dest, buildcontext string) (bool, error) {
|
||||
if excludeFile(src, buildcontext) {
|
||||
if ExcludeFile(src, buildcontext) {
|
||||
logrus.Debugf("%s found in .dockerignore, ignoring", src)
|
||||
return true, nil
|
||||
}
|
||||
@@ -601,7 +601,7 @@ func CopySymlink(src, dest, buildcontext string) (bool, error) {
|
||||
|
||||
// CopyFile copies the file at src to dest
|
||||
func CopyFile(src, dest, buildcontext string) (bool, error) {
|
||||
if excludeFile(src, buildcontext) {
|
||||
if ExcludeFile(src, buildcontext) {
|
||||
logrus.Debugf("%s found in .dockerignore, ignoring", src)
|
||||
return true, nil
|
||||
}
|
||||
@@ -645,8 +645,8 @@ func GetExcludedFiles(dockerfilepath string, buildcontext string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// excludeFile returns true if the .dockerignore specified this file should be ignored
|
||||
func excludeFile(path, buildcontext string) bool {
|
||||
// ExcludeFile returns true if the .dockerignore specified this file should be ignored
|
||||
func ExcludeFile(path, buildcontext string) bool {
|
||||
if HasFilepathPrefix(path, buildcontext, false) {
|
||||
var err error
|
||||
path, err = filepath.Rel(buildcontext, path)
|
||||
|
||||
Reference in New Issue
Block a user