Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
hongchaodeng committed Mar 8, 2020
1 parent cee6a40 commit 2d66992
Showing 1 changed file with 17 additions and 20 deletions.
37 changes: 17 additions & 20 deletions design/20200305-spec-v1alpha2-dependency-parampassing.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ We are proposing to add `dependencies` in AppConfig as follows:

```yaml
kind: ApplicationConfiguration
components:
spec:
- components:
- componentName: mysql
- componentName: web
dependencies:
Expand All @@ -39,24 +40,20 @@ Here a component can describe its dependencies, or dependent components.
For Case 1, we also suggest to use ServiceBinding in [trait-injector](https://github.com/oam-dev/trait-injector) to inject secret. It is a trait that should be applied before component starts. We propose to add `ordering` to express trait's ordering w.r.t the component.

```yaml
- componentName: web
dependencies:
- mysql
traits:
- ordering: preStart # applied before component starts
trait:
kind: ServiceBinding
spec:
bindings:
- from:
secret:
secretNameFrom: # Read secret name from MySQLInstance CR and then get secret
apiVersion: ros.aliyun.com/v1alpha2
kind: MySQLInstance
name: mysql
fieldPath: ".status.connection-secret"
to: # inject into Web Deployment's file path
filePath: /input/mysql-conn
- componentName: web
dependencies:
- mysql
traits:
- ordering: preStart # applied before component starts
trait:
kind: ServiceBinding
spec:
bindings:
- from:
secret:
name: mysql-conn
to: # inject into Web Deployment's file path
filePath: /input/mysql-conn
```

### Parameter Passing
Expand All @@ -72,7 +69,7 @@ spec:
- componentName: nas-mount-target
dependencies:
- nas-file-system
- nas-file-system
parameterValues:
- name: filesystem-id
from:
Expand Down

0 comments on commit 2d66992

Please sign in to comment.