Cleaning dead code out of the builder

Signed-off-by: Lorenzo Fontana <lo@linux.com>
This commit is contained in:
Lorenzo Fontana 2017-09-29 02:55:35 +02:00
parent 14ce1f1cf4
commit dff2a23749
No known key found for this signature in database
GPG Key ID: 0D48B0B074C3DC15
7 changed files with 5 additions and 30 deletions

View File

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

View File

@ -8,6 +8,11 @@ import (
"github.com/docker/docker/pkg/idtools" "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 { func fixPermissions(source, destination string, rootIDs idtools.IDPair, overrideSkip bool) error {
// chown is not supported on Windows // chown is not supported on Windows
return nil return nil

View File

@ -203,13 +203,6 @@ func (s *dispatchState) hasFromImage() bool {
return s.imageID != "" || (s.baseImage != nil && s.baseImage.ImageID() == "") 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) { func (s *dispatchState) beginStage(stageName string, image builder.Image) {
s.stageName = stageName s.stageName = stageName
s.imageID = image.ImageID() s.imageID = image.ImageID()

View File

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

View File

@ -29,12 +29,6 @@ import (
"github.com/pkg/errors" "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 // Archiver defines an interface for copying files from one destination to
// another using Tar/Untar. // another using Tar/Untar.
type Archiver interface { type Archiver interface {

View File

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

View File

@ -1,7 +1,6 @@
package remotecontext package remotecontext
import ( import (
"fmt"
"os" "os"
"sync" "sync"
@ -133,19 +132,6 @@ func (cs *CachableSource) Close() error {
return nil 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 // Hash returns a hash for a single file in the source
func (cs *CachableSource) Hash(path string) (string, error) { func (cs *CachableSource) Hash(path string) (string, error) {
n := cs.getRoot() n := cs.getRoot()