flip the flag
This commit is contained in:
parent
7d32139a13
commit
75864d5c85
|
|
@ -116,10 +116,6 @@ func (a *AddCommand) FilesToSnapshot() []string {
|
||||||
return a.snapshotFiles
|
return a.snapshotFiles
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *AddCommand) ProvidesFilesToSnapshot() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// String returns some information about the command for the image config
|
// String returns some information about the command for the image config
|
||||||
func (a *AddCommand) String() string {
|
func (a *AddCommand) String() string {
|
||||||
return a.cmd.String()
|
return a.cmd.String()
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ func (b *BaseCommand) FilesToSnapshot() []string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *BaseCommand) ProvidesFilesToSnapshot() bool {
|
func (b *BaseCommand) ProvidesFilesToSnapshot() bool {
|
||||||
return false
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *BaseCommand) FilesUsedFromContext(_ *v1.Config, _ *dockerfile.BuildArgs) ([]string, error) {
|
func (b *BaseCommand) FilesUsedFromContext(_ *v1.Config, _ *dockerfile.BuildArgs) ([]string, error) {
|
||||||
|
|
|
||||||
|
|
@ -138,10 +138,6 @@ func (c *CopyCommand) MetadataOnly() bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *CopyCommand) ProvidesFilesToSnapshot() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *CopyCommand) RequiresUnpackedFS() bool {
|
func (c *CopyCommand) RequiresUnpackedFS() bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
@ -218,10 +214,6 @@ func (cr *CachingCopyCommand) MetadataOnly() bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cr *CachingCopyCommand) ProvidesFilesToSnapshot() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
func (cr *CachingCopyCommand) String() string {
|
func (cr *CachingCopyCommand) String() string {
|
||||||
if cr.cmd == nil {
|
if cr.cmd == nil {
|
||||||
return "nil command"
|
return "nil command"
|
||||||
|
|
|
||||||
|
|
@ -74,8 +74,4 @@ func (w *WorkdirCommand) String() string {
|
||||||
|
|
||||||
func (w *WorkdirCommand) MetadataOnly() bool {
|
func (w *WorkdirCommand) MetadataOnly() bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *WorkdirCommand) ProvidesFilesToSnapshot() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
@ -318,6 +318,7 @@ func (s *stageBuilder) build() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
initSnapshotTaken := false
|
initSnapshotTaken := false
|
||||||
|
layer := 0
|
||||||
|
|
||||||
cacheGroup := errgroup.Group{}
|
cacheGroup := errgroup.Group{}
|
||||||
for index, command := range s.cmds {
|
for index, command := range s.cmds {
|
||||||
|
|
@ -370,7 +371,8 @@ func (s *stageBuilder) build() error {
|
||||||
if !s.shouldTakeSnapshot(index, files, command.ProvidesFilesToSnapshot()) {
|
if !s.shouldTakeSnapshot(index, files, command.ProvidesFilesToSnapshot()) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
layer++
|
||||||
|
logrus.Infof(fmt.Sprintf("%d", layer))
|
||||||
if isCacheCommand {
|
if isCacheCommand {
|
||||||
v := command.(commands.Cached)
|
v := command.(commands.Cached)
|
||||||
layer := v.Layer()
|
layer := v.Layer()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue