瀏覽代碼

Cleaning dead code out of the builder

Signed-off-by: Lorenzo Fontana <lo@linux.com>
Lorenzo Fontana 7 年之前
父節點
當前提交
dff2a23749

+ 0 - 1
builder/dockerfile/clientsession.go

@@ -41,7 +41,6 @@ func (cst *ClientSessionTransport) Copy(ctx context.Context, id fscache.RemoteId
 type ClientSessionSourceIdentifier struct {
 	includePatterns []string
 	caller          session.Caller
-	sharedKey       string
 	uuid            string
 }
 

+ 5 - 0
builder/dockerfile/copy_windows.go

@@ -8,6 +8,11 @@ import (
 	"github.com/docker/docker/pkg/idtools"
 )
 
+var pathBlacklist = map[string]bool{
+	"c:\\":        true,
+	"c:\\windows": true,
+}
+
 func fixPermissions(source, destination string, rootIDs idtools.IDPair, overrideSkip bool) error {
 	// chown is not supported on Windows
 	return nil

+ 0 - 7
builder/dockerfile/evaluator.go

@@ -203,13 +203,6 @@ func (s *dispatchState) hasFromImage() bool {
 	return s.imageID != "" || (s.baseImage != nil && s.baseImage.ImageID() == "")
 }
 
-func (s *dispatchState) isCurrentStage(target string) bool {
-	if target == "" {
-		return false
-	}
-	return strings.EqualFold(s.stageName, target)
-}
-
 func (s *dispatchState) beginStage(stageName string, image builder.Image) {
 	s.stageName = stageName
 	s.imageID = image.ImageID()

+ 0 - 1
builder/dockerfile/imagecontext.go

@@ -18,7 +18,6 @@ type imageSources struct {
 	byImageID map[string]*imageMount
 	mounts    []*imageMount
 	getImage  getAndMountFunc
-	cache     pathCache // TODO: remove
 }
 
 // TODO @jhowardmsft LCOW Support: Eventually, platform can be moved to options.Options.Platform,

+ 0 - 6
builder/dockerfile/internals.go

@@ -29,12 +29,6 @@ import (
 	"github.com/pkg/errors"
 )
 
-// For Windows only
-var pathBlacklist = map[string]bool{
-	"c:\\":        true,
-	"c:\\windows": true,
-}
-
 // Archiver defines an interface for copying files from one destination to
 // another using Tar/Untar.
 type Archiver interface {

+ 0 - 1
builder/fscache/fscache.go

@@ -217,7 +217,6 @@ func syncFrom(ctx context.Context, cs *cachedSourceRef, transport Transport, id
 }
 
 type fsCacheStore struct {
-	root     string
 	mu       sync.Mutex
 	sources  map[string]*cachedSource
 	db       *bolt.DB

+ 0 - 14
builder/remotecontext/tarsum.go

@@ -1,7 +1,6 @@
 package remotecontext
 
 import (
-	"fmt"
 	"os"
 	"sync"
 
@@ -133,19 +132,6 @@ func (cs *CachableSource) Close() error {
 	return nil
 }
 
-func (cs *CachableSource) normalize(path string) (cleanpath, fullpath string, err error) {
-	cleanpath = cs.root.Clean(string(cs.root.Separator()) + path)[1:]
-	fullpath, err = cs.root.ResolveScopedPath(path, true)
-	if err != nil {
-		return "", "", fmt.Errorf("Forbidden path outside the context: %s (%s)", path, fullpath)
-	}
-	_, err = cs.root.Lstat(fullpath)
-	if err != nil {
-		return "", "", convertPathError(err, path)
-	}
-	return
-}
-
 // Hash returns a hash for a single file in the source
 func (cs *CachableSource) Hash(path string) (string, error) {
 	n := cs.getRoot()