diff --git a/pkg/archive/diff.go b/pkg/archive/diff.go index f5f0d80a55..e365f84cc3 100644 --- a/pkg/archive/diff.go +++ b/pkg/archive/diff.go @@ -25,6 +25,13 @@ func UnpackLayer(dest string, layer Reader, options *TarOptions) (size int64, er defer pools.BufioReader32KPool.Put(trBuf) var dirs []*tar.Header + + if options == nil { + options = &TarOptions{} + } + if options.ExcludePatterns == nil { + options.ExcludePatterns = []string{} + } remappedRootUID, remappedRootGID, err := idtools.GetRootUIDGID(options.UIDMaps, options.GIDMaps) if err != nil { return 0, err