From 68a511184f833202437bbecf68bb709347e75f77 Mon Sep 17 00:00:00 2001 From: Vishal Date: Mon, 21 Jan 2019 21:37:57 +0530 Subject: [PATCH] Fix spec archives one zip file twice (#1068) --- fission/spec.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/fission/spec.go b/fission/spec.go index 909c68fc..0b07e9ae 100644 --- a/fission/spec.go +++ b/fission/spec.go @@ -975,16 +975,17 @@ func localArchiveFromSpec(specDir string, aus *ArchiveUploadSpec) (*fission.Arch files := make([]string, 0) if len(aus.IncludeGlobs) == 1 && archiver.Zip.Match(aus.IncludeGlobs[0]) { files = append(files, aus.IncludeGlobs[0]) - } - for _, relativeGlob := range aus.IncludeGlobs { - absGlob := rootDir + "/" + relativeGlob - f, err := filepath.Glob(absGlob) - if err != nil { - log.Info(fmt.Sprintf("Invalid glob in archive %v: %v", aus.Name, relativeGlob)) - return nil, err + } else { + for _, relativeGlob := range aus.IncludeGlobs { + absGlob := rootDir + "/" + relativeGlob + f, err := filepath.Glob(absGlob) + if err != nil { + log.Info(fmt.Sprintf("Invalid glob in archive %v: %v", aus.Name, relativeGlob)) + return nil, err + } + files = append(files, f...) + // xxx handle excludeGlobs here } - files = append(files, f...) - // xxx handle excludeGlobs here } if len(files) == 0 {