Skip to content

Support Platform API 0.14 #2515

@jjbustamante

Description

@jjbustamante

Description

Pack currently supports Platform API versions 0.3 through 0.15, but is missing a key feature introduced in Platform API 0.14.

See spec release: https://github.com/buildpacks/spec/releases/tag/platform%2Fv0.14

Platform API 0.14 Changes:

  • Add -run flag to the restorer binary
    • The restorer should accept a -run flag (similar to analyzer and exporter in Platform API 0.12+) to enable read access validation for run images selected by extensions
    • Implementation reference: Ensure read access to the run image selected by extensions lifecycle#1364
    • Currently, pack passes the -run flag to the analyzer (when Platform API >= 0.12) and exporter (when Platform API >= 0.12), but NOT to the restorer
    • The restorer needs this flag to verify accessibility of run images when extensions have modified the run image selection, using the platform's authentication context

Current Implementation Status

What's already implemented:

  • Platform API 0.14 is listed in supported versions (internal/build/lifecycle_executor.go)
  • -run flag support for analyzer (Platform API >= 0.12)
  • -run flag support for exporter (Platform API >= 0.12)
  • WriteRunToml helper function (internal/build/container_ops.go:264)

What's missing:

  • -run flag support for restorer (should be Platform API >= 0.14)

Proposed solution

Add the -run flag to the restorer phase when Platform API >= 0.14:

  1. Modify the Restore function in internal/build/lifecycle_execution.go (around line 520-617)
  2. Add conditional logic similar to analyzer/exporter to pass -run flag when Platform API >= 0.14
  3. Include the WriteRunToml container operation
  4. Add tests to verify the flag is passed correctly when Platform API >= 0.14

Example implementation pattern (based on analyzer at line 708):

runOp := NullOp()
if l.platformAPI.AtLeast("0.14") {
    flags = append(flags, "-run", l.mountPaths.runPath())
    runOp = WithContainerOperations(WriteRunToml(l.mountPaths.runPath(), l.opts.Builder.RunImages(), l.os))
}

Related Issues/PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    status/readyIssue ready to be worked on.type/enhancementIssue that requests a new feature or improvement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions