Browse code

Cleaning dead code out of the builder

Signed-off-by: Lorenzo Fontana <lo@linux.com>

Lorenzo Fontana authored on 2017/09/29 09:55:35
Showing 7 changed files
... ...
@@ -41,7 +41,6 @@ func (cst *ClientSessionTransport) Copy(ctx context.Context, id fscache.RemoteId
41 41
 type ClientSessionSourceIdentifier struct {
42 42
 	includePatterns []string
43 43
 	caller          session.Caller
44
-	sharedKey       string
45 44
 	uuid            string
46 45
 }
47 46
 
... ...
@@ -8,6 +8,11 @@ import (
8 8
 	"github.com/docker/docker/pkg/idtools"
9 9
 )
10 10
 
11
+var pathBlacklist = map[string]bool{
12
+	"c:\\":        true,
13
+	"c:\\windows": true,
14
+}
15
+
11 16
 func fixPermissions(source, destination string, rootIDs idtools.IDPair, overrideSkip bool) error {
12 17
 	// chown is not supported on Windows
13 18
 	return nil
... ...
@@ -203,13 +203,6 @@ func (s *dispatchState) hasFromImage() bool {
203 203
 	return s.imageID != "" || (s.baseImage != nil && s.baseImage.ImageID() == "")
204 204
 }
205 205
 
206
-func (s *dispatchState) isCurrentStage(target string) bool {
207
-	if target == "" {
208
-		return false
209
-	}
210
-	return strings.EqualFold(s.stageName, target)
211
-}
212
-
213 206
 func (s *dispatchState) beginStage(stageName string, image builder.Image) {
214 207
 	s.stageName = stageName
215 208
 	s.imageID = image.ImageID()
... ...
@@ -18,7 +18,6 @@ type imageSources struct {
18 18
 	byImageID map[string]*imageMount
19 19
 	mounts    []*imageMount
20 20
 	getImage  getAndMountFunc
21
-	cache     pathCache // TODO: remove
22 21
 }
23 22
 
24 23
 // TODO @jhowardmsft LCOW Support: Eventually, platform can be moved to options.Options.Platform,
... ...
@@ -29,12 +29,6 @@ import (
29 29
 	"github.com/pkg/errors"
30 30
 )
31 31
 
32
-// For Windows only
33
-var pathBlacklist = map[string]bool{
34
-	"c:\\":        true,
35
-	"c:\\windows": true,
36
-}
37
-
38 32
 // Archiver defines an interface for copying files from one destination to
39 33
 // another using Tar/Untar.
40 34
 type Archiver interface {
... ...
@@ -217,7 +217,6 @@ func syncFrom(ctx context.Context, cs *cachedSourceRef, transport Transport, id
217 217
 }
218 218
 
219 219
 type fsCacheStore struct {
220
-	root     string
221 220
 	mu       sync.Mutex
222 221
 	sources  map[string]*cachedSource
223 222
 	db       *bolt.DB
... ...
@@ -1,7 +1,6 @@
1 1
 package remotecontext
2 2
 
3 3
 import (
4
-	"fmt"
5 4
 	"os"
6 5
 	"sync"
7 6
 
... ...
@@ -133,19 +132,6 @@ func (cs *CachableSource) Close() error {
133 133
 	return nil
134 134
 }
135 135
 
136
-func (cs *CachableSource) normalize(path string) (cleanpath, fullpath string, err error) {
137
-	cleanpath = cs.root.Clean(string(cs.root.Separator()) + path)[1:]
138
-	fullpath, err = cs.root.ResolveScopedPath(path, true)
139
-	if err != nil {
140
-		return "", "", fmt.Errorf("Forbidden path outside the context: %s (%s)", path, fullpath)
141
-	}
142
-	_, err = cs.root.Lstat(fullpath)
143
-	if err != nil {
144
-		return "", "", convertPathError(err, path)
145
-	}
146
-	return
147
-}
148
-
149 136
 // Hash returns a hash for a single file in the source
150 137
 func (cs *CachableSource) Hash(path string) (string, error) {
151 138
 	n := cs.getRoot()