Merge pull request #180 from priyawadhwa/arg
Pass in clone of buildargs for dockerfile parsing
This commit is contained in:
commit
dec203eaff
|
|
@ -40,6 +40,13 @@ func NewBuildArgs(args []string) *BuildArgs {
|
|||
}
|
||||
}
|
||||
|
||||
func (b *BuildArgs) Clone() *BuildArgs {
|
||||
clone := b.BuildArgs.Clone()
|
||||
return &BuildArgs{
|
||||
*clone,
|
||||
}
|
||||
}
|
||||
|
||||
// ReplacementEnvs returns a list of filtered environment variables
|
||||
func (b *BuildArgs) ReplacementEnvs(envs []string) []string {
|
||||
filtered := b.FilterAllowed(envs)
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ func DoBuild(dockerfilePath, srcContext, snapshotMode string, args []string) (na
|
|||
}
|
||||
return ref, sourceImage, nil
|
||||
}
|
||||
if err := saveStageDependencies(index, stages, buildArgs); err != nil {
|
||||
if err := saveStageDependencies(index, stages, buildArgs.Clone()); err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
// Delete the filesystem
|
||||
|
|
|
|||
|
|
@ -305,9 +305,6 @@ func RelativeFiles(fp string, root string) ([]string, error) {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if PathInWhitelist(path, root) {
|
||||
return nil
|
||||
}
|
||||
relPath, err := filepath.Rel(root, path)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
|||
Loading…
Reference in New Issue