From 7b0999256514cbef97c1db73ec0d3326673db92d Mon Sep 17 00:00:00 2001 From: Rishabh Gupta Date: Thu, 4 Apr 2019 21:09:57 +0530 Subject: [PATCH] Using functions.json instead of store-arch.json Signed-off-by: Rishabh Gupta --- gateway/Dockerfile.arm64 | 3 +-- gateway/Dockerfile.armhf | 2 +- gateway/assets/script/funcstore.js | 7 +++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gateway/Dockerfile.arm64 b/gateway/Dockerfile.arm64 index 3c5be324..131b4cfe 100644 --- a/gateway/Dockerfile.arm64 +++ b/gateway/Dockerfile.arm64 @@ -43,7 +43,6 @@ RUN chown -R app:app ./ USER app -# Patch to ARM64 store -RUN sed -ie s/store.json/store-arm64.json/g /home/app/assets/script/funcstore.js +RUN sed -ie s/x86_64/arm64.json/g /home/app/assets/script/funcstore.js CMD ["./gateway"] diff --git a/gateway/Dockerfile.armhf b/gateway/Dockerfile.armhf index 0110a565..963c2594 100644 --- a/gateway/Dockerfile.armhf +++ b/gateway/Dockerfile.armhf @@ -55,7 +55,7 @@ ENV https_proxy "" COPY --from=build /go/src/github.com/openfaas/faas/gateway/gateway . COPY assets assets -RUN sed -ie s/store.json/store-armhf.json/g /home/app/assets/script/funcstore.js +RUN sed -ie s/x86_64/armhf/g /home/app/assets/script/funcstore.js RUN chown -R app:app ./ USER app diff --git a/gateway/assets/script/funcstore.js b/gateway/assets/script/funcstore.js index c39ad783..a46857f5 100644 --- a/gateway/assets/script/funcstore.js +++ b/gateway/assets/script/funcstore.js @@ -20,7 +20,8 @@ funcStoreModule.component('funcStore', { controller: ['FuncStoreService', '$mdDialog', '$window', function FuncStoreController(FuncStoreService, $mdDialog, $window) { var self = this; - this.storeUrl = 'https://raw.githubusercontent.com/openfaas/store/master/store.json'; + this.arch = "x86_64"; + this.storeUrl = 'https://raw.githubusercontent.com/openfaas/store/master/functions.json'; this.selectedFunc = null; this.functions = []; this.message = ''; @@ -47,7 +48,9 @@ funcStoreModule.component('funcStore', { FuncStoreService.fetchStore(self.storeUrl) .then(function (data) { self.loading = false; - self.functions = data; + self.functions = data.functions + .filter(f => f.images.hasOwnProperty(self.arch)) + .map(f => Object.assign(f, { "image": f["images"][self.arch] })); }) .catch(function (err) { console.error(err);