Skip to content

Commit

Permalink
Merge pull request #1393 from tonistiigi/xattr-hash
Browse files Browse the repository at this point in the history
contenthash: ignore system and security xattrs in calculation
  • Loading branch information
tonistiigi authored Mar 4, 2020
2 parents 09900f3 + 81e7113 commit a276ba7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cache/contenthash/tarsum.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"io"
"sort"
"strconv"
"strings"
)

// WriteV1TarsumHeaders writes a tar header to a writer in V1 tarsum format.
Expand Down Expand Up @@ -38,7 +39,9 @@ func v1TarHeaderSelect(h *tar.Header) (orderedHeaders [][2]string) {
// Get extended attributes.
xAttrKeys := make([]string, len(h.Xattrs))
for k := range h.Xattrs {
xAttrKeys = append(xAttrKeys, k)
if !strings.HasPrefix(k, "security.") && !strings.HasPrefix(k, "system.") {
xAttrKeys = append(xAttrKeys, k)
}
}
sort.Strings(xAttrKeys)

Expand Down

0 comments on commit a276ba7

Please sign in to comment.