From bca7a626268875c013f6b458a898f56053ff1728 Mon Sep 17 00:00:00 2001 From: Thorarinn Sigurdsson Date: Thu, 27 Jun 2019 18:40:54 +0200 Subject: [PATCH] fix(openfaas): regression in openfaas provider init --- garden-service/src/plugins/openfaas/openfaas.ts | 7 ++++--- .../static/openfaas/system/openfaas-system/garden.yml | 6 ++++++ .../static/openfaas/system/openfaas-templates/garden.yml | 4 ++++ 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 garden-service/static/openfaas/system/openfaas-system/garden.yml create mode 100644 garden-service/static/openfaas/system/openfaas-templates/garden.yml diff --git a/garden-service/src/plugins/openfaas/openfaas.ts b/garden-service/src/plugins/openfaas/openfaas.ts index 606516d1df..4325e57afe 100644 --- a/garden-service/src/plugins/openfaas/openfaas.ts +++ b/garden-service/src/plugins/openfaas/openfaas.ts @@ -41,11 +41,12 @@ import { GetServiceLogsParams } from "../../types/plugin/service/getServiceLogs" import { DeleteServiceParams } from "../../types/plugin/service/deleteService" import { HelmModuleConfig } from "../kubernetes/helm/config" import { keyBy, union } from "lodash" -import { DEFAULT_API_VERSION } from "../../constants" +import { DEFAULT_API_VERSION, STATIC_DIR } from "../../constants" import { ExecModuleConfig } from "../exec" import { ConfigureProviderParams, ConfigureProviderResult } from "../../types/plugin/provider/configureProvider" import { KubernetesDeployment } from "../kubernetes/types" +const systemDir = join(STATIC_DIR, "openfaas", "system") export const stackFilename = "stack.yml" export interface OpenFaasModuleSpec extends ExecModuleSpec { @@ -148,7 +149,7 @@ const templateModuleConfig: ExecModuleConfig = { }, description: "OpenFaaS templates for building functions", name: "templates", - path: __dirname, + path: join(systemDir, "openfaas-templates"), repositoryUrl: "https://github.com/openfaas/templates.git#master", outputs: {}, serviceConfigs: [], @@ -203,7 +204,7 @@ async function configureProvider( description: "OpenFaaS runtime", name: "system", outputs: {}, - path: __dirname, + path: join(systemDir, "openfaas-system"), serviceConfigs: [], taskConfigs: [], testConfigs: [], diff --git a/garden-service/static/openfaas/system/openfaas-system/garden.yml b/garden-service/static/openfaas/system/openfaas-system/garden.yml new file mode 100644 index 0000000000..1cccf8679e --- /dev/null +++ b/garden-service/static/openfaas/system/openfaas-system/garden.yml @@ -0,0 +1,6 @@ +kind: Module +name: system +description: "OpenFaaS runtime" +type: helm +chart: openfaas +repo: "https://openfaas.github.io/faas-netes/" \ No newline at end of file diff --git a/garden-service/static/openfaas/system/openfaas-templates/garden.yml b/garden-service/static/openfaas/system/openfaas-templates/garden.yml new file mode 100644 index 0000000000..1d2f35590e --- /dev/null +++ b/garden-service/static/openfaas/system/openfaas-templates/garden.yml @@ -0,0 +1,4 @@ +kind: Module +name: templates +description: "OpenFaaS templates" +type: exec \ No newline at end of file