Skip to content

Commit ffbc1ce

Browse files
authored
Merge pull request moby#4086 from jedevc/remove-exclude-override
filesync: remove deprecated override-excludes
2 parents 408e432 + 1ec36ec commit ffbc1ce

File tree

2 files changed

+19
-29
lines changed

2 files changed

+19
-29
lines changed

session/filesync/filesync.go

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
)
2222

2323
const (
24-
keyOverrideExcludes = "override-excludes"
2524
keyIncludePatterns = "include-patterns"
2625
keyExcludePatterns = "exclude-patterns"
2726
keyFollowPaths = "followpaths"
@@ -36,9 +35,8 @@ type fsSyncProvider struct {
3635
}
3736

3837
type SyncedDir struct {
39-
Dir string
40-
Excludes []string
41-
Map func(string, *fstypes.Stat) fsutil.MapResult
38+
Dir string
39+
Map func(string, *fstypes.Stat) fsutil.MapResult
4240
}
4341

4442
type DirSource interface {
@@ -99,9 +97,6 @@ func (sp *fsSyncProvider) handle(method string, stream grpc.ServerStream) (retEr
9997
}
10098

10199
excludes := opts[keyExcludePatterns]
102-
if len(dir.Excludes) != 0 && (len(opts[keyOverrideExcludes]) == 0 || opts[keyOverrideExcludes][0] != "true") {
103-
excludes = dir.Excludes
104-
}
105100
includes := opts[keyIncludePatterns]
106101

107102
followPaths := opts[keyFollowPaths]
@@ -155,16 +150,15 @@ var supportedProtocols = []protocol{
155150

156151
// FSSendRequestOpt defines options for FSSend request
157152
type FSSendRequestOpt struct {
158-
Name string
159-
IncludePatterns []string
160-
ExcludePatterns []string
161-
FollowPaths []string
162-
OverrideExcludes bool // deprecated: this is used by docker/cli for automatically loading .dockerignore from the directory
163-
DestDir string
164-
CacheUpdater CacheUpdater
165-
ProgressCb func(int, bool)
166-
Filter func(string, *fstypes.Stat) bool
167-
Differ fsutil.DiffType
153+
Name string
154+
IncludePatterns []string
155+
ExcludePatterns []string
156+
FollowPaths []string
157+
DestDir string
158+
CacheUpdater CacheUpdater
159+
ProgressCb func(int, bool)
160+
Filter func(string, *fstypes.Stat) bool
161+
Differ fsutil.DiffType
168162
}
169163

170164
// CacheUpdater is an object capable of sending notifications for the cache hash changes
@@ -188,9 +182,6 @@ func FSSync(ctx context.Context, c session.Caller, opt FSSendRequestOpt) error {
188182
}
189183

190184
opts := make(map[string][]string)
191-
if opt.OverrideExcludes {
192-
opts[keyOverrideExcludes] = []string{"true"}
193-
}
194185

195186
if opt.IncludePatterns != nil {
196187
opts[keyIncludePatterns] = opt.IncludePatterns

source/local/local.go

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -186,15 +186,14 @@ func (ls *localSourceHandler) snapshot(ctx context.Context, caller session.Calle
186186
}
187187

188188
opt := filesync.FSSendRequestOpt{
189-
Name: ls.src.Name,
190-
IncludePatterns: ls.src.IncludePatterns,
191-
ExcludePatterns: ls.src.ExcludePatterns,
192-
FollowPaths: ls.src.FollowPaths,
193-
OverrideExcludes: false,
194-
DestDir: dest,
195-
CacheUpdater: &cacheUpdater{cc, mount.IdentityMapping()},
196-
ProgressCb: newProgressHandler(ctx, "transferring "+ls.src.Name+":"),
197-
Differ: ls.src.Differ,
189+
Name: ls.src.Name,
190+
IncludePatterns: ls.src.IncludePatterns,
191+
ExcludePatterns: ls.src.ExcludePatterns,
192+
FollowPaths: ls.src.FollowPaths,
193+
DestDir: dest,
194+
CacheUpdater: &cacheUpdater{cc, mount.IdentityMapping()},
195+
ProgressCb: newProgressHandler(ctx, "transferring "+ls.src.Name+":"),
196+
Differ: ls.src.Differ,
198197
}
199198

200199
if idmap := mount.IdentityMapping(); idmap != nil {

0 commit comments

Comments
 (0)