Skip to content

Commit f07a3f3

Browse files
authored
Merge pull request #2255 from FabianKramm/main
fix: deployment of component chart
2 parents 01f7496 + e443359 commit f07a3f3

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

pkg/util/hash/hash.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,21 @@ func DirectoryExcludes(srcPath string, excludePatterns []string, fast bool) (str
8989

9090
hash := sha256.New()
9191

92+
// Stat dir / file
93+
fileInfo, err := os.Stat(srcPath)
94+
if err != nil {
95+
return "", err
96+
}
97+
98+
// Hash file
99+
if !fileInfo.IsDir() {
100+
size := strconv.FormatInt(fileInfo.Size(), 10)
101+
mTime := strconv.FormatInt(fileInfo.ModTime().UnixNano(), 10)
102+
_, _ = io.WriteString(hash, srcPath+";"+size+";"+mTime)
103+
104+
return fmt.Sprintf("%x", hash.Sum(nil)), nil
105+
}
106+
92107
// Fix the source path to work with long path names. This is a no-op
93108
// on platforms other than Windows.
94109
if runtime.GOOS == "windows" {

0 commit comments

Comments
 (0)