|
| 1 | +#[derive(Clone, Debug)] |
1 | 2 | pub struct Target {
|
2 | 3 | /// The name of the target operating system.
|
3 | 4 | ///
|
4 | 5 | /// The value should conform to [Go's `$GOOS`](https://golang.org/doc/install/source#environment), for example
|
5 | 6 | /// `linux` or `windows`.
|
6 | 7 | ///
|
7 |
| - /// CNB `lifecycle` sources this value from the build OCI image's [`os` property](https://github.com/opencontainers/image-spec/blob/main/config.md#properties). |
| 8 | + /// CNB `lifecycle` sources this value from the run OCI image's [`os` property](https://github.com/opencontainers/image-spec/blob/main/config.md#properties). |
8 | 9 | pub os: String,
|
9 | 10 | /// The name of the target CPU architecture.
|
10 | 11 | ///
|
11 | 12 | /// The value should conform to [Go's $GOARCH](https://golang.org/doc/install/source#environment), for example
|
12 | 13 | /// `amd64` or `arm64`.
|
13 | 14 | ///
|
14 |
| - /// CNB `lifecycle` sources this value from the build OCI image's [`architecture` property](https://github.com/opencontainers/image-spec/blob/main/config.md#properties). |
| 15 | + /// CNB `lifecycle` sources this value from the run OCI image's [`architecture` property](https://github.com/opencontainers/image-spec/blob/main/config.md#properties). |
15 | 16 | pub arch: String,
|
16 | 17 | /// The variant of the specified CPU architecture.
|
17 | 18 | ///
|
18 | 19 | /// The value should conform to [OCI image spec platform variants](https://github.com/opencontainers/image-spec/blob/main/image-index.md#platform-variants), for example
|
19 | 20 | /// `v7` or `v8`.
|
20 | 21 | ///
|
21 |
| - /// CNB `lifecycle` sources this value from the build OCI image's [`variant` property](https://github.com/opencontainers/image-spec/blob/main/config.md#properties). |
| 22 | + /// CNB `lifecycle` sources this value from the run OCI image's [`variant` property](https://github.com/opencontainers/image-spec/blob/main/config.md#properties). |
22 | 23 | pub arch_variant: Option<String>,
|
23 | 24 | /// The name of the operating system distribution. Should be empty for Windows.
|
24 | 25 | ///
|
25 | 26 | /// For example: `ubuntu` or `alpine`.
|
26 | 27 | ///
|
27 |
| - /// CNB `lifecycle` sources this value from the build OCI image's `io.buildpacks.base.distro.name` label. |
28 |
| - pub distro_name: Option<String>, |
| 28 | + /// CNB `lifecycle` sources this value from either: |
| 29 | + /// 1. The `io.buildpacks.base.distro.name` OCI image label, if set on the run image. |
| 30 | + /// 2. Or else, the `ID` field of the `/etc/os-release` file in the build image. |
| 31 | + pub distro_name: String, |
29 | 32 | /// The version of the operating system distribution.
|
30 | 33 | ///
|
31 | 34 | /// For example: `22.04` or `3.19`.
|
32 | 35 | ///
|
33 |
| - /// CNB `lifecycle` sources this value from the build OCI image's `io.buildpacks.base.distro.version` label. |
34 |
| - pub distro_version: Option<String>, |
| 36 | + /// CNB `lifecycle` sources this value from either: |
| 37 | + /// 1. The `io.buildpacks.base.distro.version` OCI image label, if set on the run image. |
| 38 | + /// 2. Or else, the `VERSION_ID` field of the `/etc/os-release` file in the build image. |
| 39 | + pub distro_version: String, |
35 | 40 | }
|
0 commit comments