Change flag name to KeepArchive for backward compatibility (#787)

This commit is contained in:
Ta-Ching Chen
2018-07-06 03:13:07 +08:00
committed by GitHub
parent 5b6582698c
commit 61569d1c38
8 changed files with 34 additions and 33 deletions
+9 -9
View File
@@ -29,14 +29,14 @@ type (
FetchRequestType int
FetchRequest struct {
FetchType FetchRequestType `json:"fetchType"`
Package metav1.ObjectMeta `json:"package"`
Url string `json:"url"`
StorageSvcUrl string `json:"storagesvcurl"`
Filename string `json:"filename"`
Secrets []fission.SecretReference `json:"secretList"`
ConfigMaps []fission.ConfigMapReference `json:"configMapList"`
ExtractArchive bool `json:"extractarchive"`
FetchType FetchRequestType `json:"fetchType"`
Package metav1.ObjectMeta `json:"package"`
Url string `json:"url"`
StorageSvcUrl string `json:"storagesvcurl"`
Filename string `json:"filename"`
Secrets []fission.SecretReference `json:"secretList"`
ConfigMaps []fission.ConfigMapReference `json:"configMapList"`
KeepArchive bool `json:"keeparchive"`
}
// UploadRequest send from builder manager describes which
@@ -293,7 +293,7 @@ func (fetcher *Fetcher) Fetch(req FetchRequest) (int, error) {
}
}
if archiver.Zip.Match(tmpPath) && req.ExtractArchive {
if archiver.Zip.Match(tmpPath) && !req.KeepArchive {
// unarchive tmp file to a tmp unarchive path
tmpUnarchivePath := filepath.Join(fetcher.sharedVolumePath, uuid.NewV4().String())
err := fetcher.unarchive(tmpPath, tmpUnarchivePath)