Skip to content

Commit

Permalink
Merge pull request #406 from sap-contributions/update-layer-types-table
Browse files Browse the repository at this point in the history
Restore cached layer metadata for `launch: true` & `cache: true` from cache as a fallback
  • Loading branch information
natalieparellano authored Jun 25, 2024
2 parents 86fde51 + 9343e24 commit a633975
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions buildpack.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,20 +251,18 @@ The lifecycle MUST treat a layer with unset `types` as a `launch = false`, `buil
The following table illustrates the behavior depending on the value of each flag.
Note that the lifecycle only restores layers from the cache, never from the previous image.

`build` | `cache` | `launch` | Metadata and SBOM** Restored | Layer Restored
----------|----------|----------|------------------------------|---------------------
true | true | true | Yes - from the app image | Yes* - from the cache
true | true | false | Yes - from the cache | Yes - from the cache
true | false | true | No | No
true | false | false | No | No
false | true | true | Yes - from the app image | Yes* - from the cache
false | true | false | Yes - from the cache | Yes - from the cache
false | false | true | Yes - from the app image | No
false | false | false | No | No

\* The metadata and layer are restored only if the layer SHA recorded in the previous image matches the layer SHA recorded in the cache.

\** Only SBOM files associated with a layer are restored. Launch-level and build-level SBOM files must be re-created on each build.
| `build` | `cache` | `launch` | Metadata and SBOM* Restored | Layer Restored |
| ------- | ------- | -------- | --------------------------- | -------------- |
| true | true | true | Yes | Yes |
| true | true | false | Yes | Yes |
| true | false | true | No | No |
| true | false | false | No | No |
| false | true | true | Yes | Yes* |
| false | true | false | Yes | Yes |
| false | false | true | Yes | No |
| false | false | false | No | No |

\* Only SBOM files associated with a layer are restored. Launch-level and build-level SBOM files must be re-created on each build.

Examples:
* `build = true, cache = true, launch = true`:
Expand Down

0 comments on commit a633975

Please sign in to comment.