Skip to content

Commit

Permalink
introduce ability for override to reset value to null
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
  • Loading branch information
ndeloof committed Apr 17, 2023
1 parent 1512616 commit 9dabe2e
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
25 changes: 25 additions & 0 deletions 13-merge.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,30 @@ services:
- bar:/work
```

### Reset value

In addition to the previously described mechanism, an override Compose file can also be used to remove elements from application model.
For this purpose, custom YAML tag `!reset` can be set to override value set by the overriden Compose file, and replace with default
value or `null` on target attribute.

Merging the following example YAML trees:
```yaml
services:
foo:
build:
context: /path
```

```yaml
services:
foo:
build: !reset
```

MUST result in a Compose application model equivalent to the YAML tree:

```yaml
services:
foo:
build: null
```
25 changes: 25 additions & 0 deletions spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -2721,5 +2721,30 @@ services:
- bar:/work
```

### Reset value

In addition to the previously described mechanism, an override Compose file can also be used to remove elements from application model.
For this purpose, custom YAML tag `!reset` can be set to override value set by the overriden Compose file, and replace with default
value or `null` on target attribute.

Merging the following example YAML trees:
```yaml
services:
foo:
build:
context: /path
```

```yaml
services:
foo:
build: !reset
```

MUST result in a Compose application model equivalent to the YAML tree:

```yaml
services:
foo:
build: null
```

0 comments on commit 9dabe2e

Please sign in to comment.