mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-04 21:22:14 +02:00
Merge pull request #180 from priyawadhwa/arg
Pass in clone of buildargs for dockerfile parsing
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user