From ba0ecf03dd2594e1c3ed2702803706731e796c83 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Thu, 29 Sep 2016 11:36:57 +0200 Subject: [PATCH] Fix bugs around reading in datafiles and Dockerfiles We now properly try to read archives in all three formats. If none are valid, the dataFileService.readDataArrayAsPossibleArchive fails (as it should), and then the Dockerfile service will try to read the file directly as a Dockerfile. Fixes #1889 Fixes #1891 --- static/js/services/datafile-service.js | 4 +++- static/js/services/dockerfile-service.js | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/static/js/services/datafile-service.js b/static/js/services/datafile-service.js index cbb458fa5..6461a8e99 100644 --- a/static/js/services/datafile-service.js +++ b/static/js/services/datafile-service.js @@ -133,7 +133,9 @@ angular.module('quay').factory('DataFileService', [function() { dataFileService.readDataArrayAsPossibleArchive = function(buf, success, failure) { dataFileService.tryAsZip_(buf, success, function() { - dataFileService.tryAsTarGz_(buf, success, failure); + dataFileService.tryAsTarGz_(buf, success, function() { + dataFileService.tryAsTar_(buf, success, failure); + }); }); }; diff --git a/static/js/services/dockerfile-service.js b/static/js/services/dockerfile-service.js index c6f1d199f..42e6c5a6c 100644 --- a/static/js/services/dockerfile-service.js +++ b/static/js/services/dockerfile-service.js @@ -87,7 +87,10 @@ angular.module('quay').factory('DockerfileService', ['DataFileService', 'Config' var dataArray = reader.result; DataFileService.readDataArrayAsPossibleArchive(dataArray, function(files) { processFiles(files, dataArray, success, failure); - }, failure); + }, function() { + // Not an archive. Read directly as a single file. + processFiles([], dataArray, success, failure); + }); }; reader.onerror = failure;