Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: platform vars #367

Merged
merged 3 commits into from
Aug 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions platform.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Examples of a platform might include:
- [Environment](#environment)
- [Buildpack Environment](#buildpack-environment)
- [Base Image-Provided Variables](#base-image-provided-variables)
- [POSIX Path Variables](#posix-path-variables)
- [User-Provided Variables](#user-provided-variables)
- [Operator-Defined Variables](#operator-defined-variables)
- [Launch Environment](#launch-environment)
Expand Down Expand Up @@ -1133,6 +1134,8 @@ buildpack without modification:
|-----------------------------|--------------------------------|
| `HOME` | Current user's home directory |

##### POSIX Path Variables

The following variables SHOULD be set in the lifecycle execution environment and MAY be modified by prior buildpacks before they are provided to a given buildpack:

| Env Variable | Layer Path | Contents |
Expand All @@ -1148,24 +1151,29 @@ The platform SHOULD NOT assume any other base-image-provided environment variabl
##### User-Provided Variables

User-provided environment variables MUST be supplied by the platform as files in the `<platform>/env/` directory.

Each file SHALL define a single environment variable, where the file name defines the key and the file contents define the value.

User-provided environment variables MAY be modified by prior buildpacks before they are provided to a given buildpack.
User-provided environment variables that are [POSIX path variables](#posix-path-variables) MAY be modified by prior buildpacks before they are provided to a given buildpack,
however the user-provided value is always prepended to the buildpack-provided value.

The platform SHOULD NOT set user-provided environment variables directly in the lifecycle execution environment.
User-provided environment variables that are not POSIX path variables MAY NOT be modified by prior buildpacks before they are provided to a given buildpack.

The `<platform>/env/` directory follows the same convention as [Environment Variable Modification Rules](https://github.com/buildpacks/spec/blob/main/buildpack.md#environment-variable-modification-rules).
The platform SHOULD NOT set user-provided environment variables directly in the lifecycle execution environment.

##### Operator-Defined Variables
Operator-provided environment varaiables MUST be supplied by the platform as files in the `<build-config>/env/` directory.

Operator-provided environment variables MUST be supplied by the platform as files in the `<build-config>/env/` directory.

Each file SHALL define a single environment variable, where the file name defines the key and the file contents define the value.

Operator-defined environment variables MAY be modified by subsequent buildpacks before they are provided to a given buildpack.
The `<build-config>/env/` directory follows the [Environment Variable Modification Rules](https://github.com/buildpacks/spec/blob/main/buildpack.md#environment-variable-modification-rules)
outlined in the [Buildpack Interface Specification](buildpack.md), except for the modification behavior when no period-delimited suffix is provided; when no suffix is provided, the behavior is `default`.

The platform SHOULD NOT set operator-provided environment variables directly in the lifecycle execution environment.
Operator-defined environment variables MAY be modified by prior buildpacks before they are provided to a given buildpack,
however the operator-defined value is always applied after the buildpack-provided value.

The `<build-config>/env/` directory follows the [Environment Variable Modification Rules](https://github.com/buildpacks/spec/blob/main/buildpack.md#environment-variable-modification-rules) outlined in the [Buildpack Interface Specification](buildpack.md), except for the modification behavior when no period-delimited suffix is provided; when no suffix is provided, the behavior is `default`.
The platform SHOULD NOT set operator-provided environment variables directly in the lifecycle execution environment.

#### Launch Environment

Expand Down