Skip to content

Commit

Permalink
External resources SHOULD not allow passing other attributes
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 9, 2022
1 parent b9bab6f commit 24e1994
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spec.md
Expand Up @@ -2049,6 +2049,9 @@ Compose implementations MUST set `com.docker.compose.project` and `com.docker.co
If set to `true`, `external` specifies that this network’s lifecycle is maintained outside of that of the application.
Compose Implementations SHOULD NOT attempt to create these networks, and raises an error if one doesn't exist.

If `external` is set to `true` and network configuration has other but `name` attributes set, considering resource is
not managed by compose lifecycle, Compose Implementations SHOULD reject a Compose file as invalid.

In the example below, `proxy` is the gateway to the outside world. Instead of attempting to create a network, Compose
implementations SHOULD interrogate the platform for an existing network simply called `outside` and connect the
`proxy` service's containers to it.
Expand Down Expand Up @@ -2147,6 +2150,10 @@ If set to `true`, `external` specifies that this volume already exist on the pla
of that of the application. Compose implementations MUST NOT attempt to create these volumes, and MUST return an error if they
do not exist.

If `external` is set to `true` and volume configuration has other but `name` attributes set, considering resource is
not managed by compose lifecycle, Compose Implementations SHOULD reject a Compose file as invalid.


In the example below, instead of attempting to create a volume called
`{project_name}_db-data`, Compose looks for an existing volume simply
called `db-data` and mounts it into the `backend` service's containers.
Expand Down Expand Up @@ -2271,6 +2278,9 @@ configs:
name: "${HTTP_CONFIG_KEY}"
```

If `external` is set to `true` and secret configuration has other but `name` attributes set, considering resource is
not managed by compose lifecycle, Compose Implementations SHOULD reject a Compose file as invalid.

Compose file need to explicitly grant access to the configs to relevant services in the application.

## Secrets top-level element
Expand Down Expand Up @@ -2316,6 +2326,9 @@ secrets:
name: "${CERTIFICATE_KEY}"
```

If `external` is set to `true` and secret configuration has other but `name` attributes set, considering resource is
not managed by compose lifecycle, Compose Implementations SHOULD reject a Compose file as invalid.

Compose file need to explicitly grant access to the secrets to relevant services in the application.

## Fragments
Expand Down

0 comments on commit 24e1994

Please sign in to comment.