mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-21 08:17:12 +02:00
copy symlinks (#90)
This commit is contained in:
@@ -142,11 +142,11 @@ func IsDestDir(path string) bool {
|
||||
// Assume dest is also a dir, and copy to dest/relpath
|
||||
// If dest is not an absolute filepath, add /cwd to the beginning
|
||||
func DestinationFilepath(filename, srcName, dest, cwd, buildcontext string) (string, error) {
|
||||
fi, err := os.Stat(filepath.Join(buildcontext, filename))
|
||||
fi, err := os.Lstat(filepath.Join(buildcontext, filename))
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
src, err := os.Stat(filepath.Join(buildcontext, srcName))
|
||||
src, err := os.Lstat(filepath.Join(buildcontext, srcName))
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
+2
-2
@@ -137,7 +137,7 @@ func Files(root string) ([]string, error) {
|
||||
|
||||
// FilepathExists returns true if the path exists
|
||||
func FilepathExists(path string) bool {
|
||||
_, err := os.Stat(path)
|
||||
_, err := os.Lstat(path)
|
||||
return !os.IsNotExist(err)
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ func FilepathExists(path string) bool {
|
||||
func CreateFile(path string, reader io.Reader, perm os.FileMode) error {
|
||||
// Create directory path if it doesn't exist
|
||||
baseDir := filepath.Dir(path)
|
||||
if _, err := os.Stat(baseDir); os.IsNotExist(err) {
|
||||
if _, err := os.Lstat(baseDir); os.IsNotExist(err) {
|
||||
logrus.Debugf("baseDir %s for file %s does not exist. Creating.", baseDir, path)
|
||||
if err := os.MkdirAll(baseDir, 0755); err != nil {
|
||||
return err
|
||||
|
||||
@@ -148,7 +148,7 @@ func fileIsUncompressedTar(src string) bool {
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
fi, err := os.Stat(src)
|
||||
fi, err := os.Lstat(src)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user