Skip to content

feat: add platform support to pack builder#3603

Open
matejvasek wants to merge 1 commit intoknative:mainfrom
matejvasek:platform-pack
Open

feat: add platform support to pack builder#3603
matejvasek wants to merge 1 commit intoknative:mainfrom
matejvasek:platform-pack

Conversation

@matejvasek
Copy link
Copy Markdown
Contributor

Changes

  • feat: add platform support to pack builder

    The pack builder previously rejected any --platform flag with a hard error. Since the pack library already supports a Platform field in BuildOptions, this enables single-platform builds following the same pattern as the s2i builder: resolve the builder image via docker.GetPlatformImage and set opts.Platform so pack also pulls the correct run image.

    Multiple platforms are still rejected with a clear error, and omitting --platform continues to work as before.

feat: add platform support to pack builder

@knative-prow knative-prow bot requested review from dsimansk and jrangelramos April 12, 2026 12:48
@knative-prow
Copy link
Copy Markdown

knative-prow bot commented Apr 12, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: matejvasek

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow bot added approved 🤖 PR has been approved by an approver from all required OWNERS files. size/L 🤖 PR changes 100-499 lines, ignoring generated files. labels Apr 12, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 12, 2026

Codecov Report

❌ Patch coverage is 58.82353% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.25%. Comparing base (ada57d2) to head (280321f).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/errors.go 0.00% 3 Missing ⚠️
pkg/buildpacks/builder.go 72.72% 2 Missing and 1 partial ⚠️
cmd/build.go 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3603      +/-   ##
==========================================
- Coverage   56.26%   56.25%   -0.02%     
==========================================
  Files         180      180              
  Lines       20504    20522      +18     
==========================================
+ Hits        11537    11544       +7     
- Misses       7762     7775      +13     
+ Partials     1205     1203       -2     
Flag Coverage Δ
e2e 36.19% <11.76%> (+0.06%) ⬆️
e2e go 32.84% <7.69%> (+0.26%) ⬆️
e2e node 28.59% <7.69%> (+0.27%) ⬆️
e2e python 33.21% <7.69%> (+0.28%) ⬆️
e2e quarkus 28.73% <7.69%> (+0.27%) ⬆️
e2e rust 28.08% <7.69%> (+0.20%) ⬆️
e2e springboot 26.59% <7.69%> (+0.27%) ⬆️
e2e typescript 28.70% <7.69%> (+0.27%) ⬆️
e2e-config-ci 18.07% <7.69%> (-0.02%) ⬇️
integration 17.45% <0.00%> (+0.02%) ⬆️
unit macos-14 43.30% <53.84%> (-0.07%) ⬇️
unit macos-latest 43.30% <53.84%> (-0.07%) ⬇️
unit ubuntu-24.04-arm 43.50% <58.82%> (-0.06%) ⬇️
unit ubuntu-latest 44.18% <53.84%> (-0.07%) ⬇️
unit windows-latest 43.33% <53.84%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The pack builder previously rejected any --platform flag
with a hard error. Since the pack library already supports
a Platform field in BuildOptions, this enables single-platform
builds following the same pattern as the s2i builder: resolve
the builder image via docker.GetPlatformImage and set
opts.Platform so pack also pulls the correct run image.

Multiple platforms are still rejected with a clear error,
and omitting --platform continues to work as before.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Matej Vašek <matejvasek@gmail.com>
@matejvasek
Copy link
Copy Markdown
Contributor Author

ptal @lkingland @gauron99

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved 🤖 PR has been approved by an approver from all required OWNERS files. size/L 🤖 PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant