Skip to content

Commit

Permalink
Merge pull request #490 from garden-io/fix-templating-issue
Browse files Browse the repository at this point in the history
fix(core): certain template strings could not be resolved in configs
  • Loading branch information
edvald authored Feb 1, 2019
2 parents a50f2fd + 6c209af commit eb76d00
Show file tree
Hide file tree
Showing 100 changed files with 1,331 additions and 1,602 deletions.
11 changes: 9 additions & 2 deletions docs/examples/hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,19 @@ module:
name: hello-container
services:
...
env:
FUNCTION_ENDPOINT: ${services.hello-function.outputs.endpoint}
dependencies:
- hello-function
env:
FUNCTION_ENDPOINT: ${modules.hello-function.outputs.endpoint}
```

Note the added `dependencies` key, which specified `hello-function` as a runtime dependency for the `hello-container`
service.

Here we also reference the module outputs from the OpenFaaS module using a templated string, in order to inform the
container service where the endpoint for the function is. Please refer to individual provider docs on which values
are exposed under the `outputs` key on different module types.

Test dependencies will be covered further ahead.

# Defining ports, endpoints, and health checks
Expand Down
9 changes: 0 additions & 9 deletions docs/reference/module-types/container.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,6 @@ The names of any services that this service depends on at runtime, and the names
| Type | Required |
| ---- | -------- |
| `array[string]` | No
### `module.services[].outputs`
[module](#module) > [services](#module.services[]) > outputs

Key/value map. Keys must be valid identifiers.

| Type | Required |
| ---- | -------- |
| `object` | No
### `module.services[].args[]`
[module](#module) > [services](#module.services[]) > args

Expand Down Expand Up @@ -493,7 +485,6 @@ module:
services:
- name:
dependencies: []
outputs: {}
args:
daemon: false
ingresses:
Expand Down
11 changes: 0 additions & 11 deletions docs/reference/template-strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,6 @@ environment:
modules:
{}
# Retrieve information about services that are defined in the project.
#
# Example:
# my-service:
# outputs:
# ingress: 'http://my-service/path/to/endpoint'
# version: v17ad4cb3fd
#
services:
{}
# A map of all configured plugins/providers for this environment and their configuration.
#
# Example:
Expand Down
4 changes: 2 additions & 2 deletions examples/hello-world/services/hello-container/garden.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module:
dependencies:
- hello-function
env:
FUNCTION_ENDPOINT: ${services.hello-function.outputs.endpoint}
FUNCTION_ENDPOINT: ${modules.hello-function.outputs.endpoint}
build:
dependencies:
- name: hello-npm-package
Expand All @@ -31,6 +31,6 @@ module:
- name: integ
args: [npm, run, integ]
env:
FUNCTION_ENDPOINT: ${services.hello-function.outputs.endpoint}
FUNCTION_ENDPOINT: ${modules.hello-function.outputs.endpoint}
dependencies:
- hello-function
3 changes: 2 additions & 1 deletion garden-service/bin/add-version-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ async function addVersionFiles() {
const staticPath = resolve(__dirname, "..", "static")
const garden = await Garden.factory(staticPath)

const modules = await garden.getModules()
const graph = await garden.getConfigGraph()
const modules = await graph.getModules()

return Bluebird.map(modules, async (module) => {
const path = module.path
Expand Down
Loading

0 comments on commit eb76d00

Please sign in to comment.