Merge pull request #1089 from TomChv/fix/multi-arch-export

Fix export issue on multi-arch
This commit is contained in:
Sam Alba 2021-11-02 10:58:40 -07:00 committed by GitHub
commit 2cc3f9ad5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -854,7 +854,7 @@ func (p *Pipeline) PushContainer(ctx context.Context, op *compiler.Value, st llb
"name": ref.String(), "name": ref.String(),
"push": "true", "push": "true",
}, },
}) }, p.platform)
if err != nil { if err != nil {
return st, err return st, err
@ -913,7 +913,7 @@ func (p *Pipeline) SaveImage(ctx context.Context, op *compiler.Value, st llb.Sta
Output: func(_ map[string]string) (io.WriteCloser, error) { Output: func(_ map[string]string) (io.WriteCloser, error) {
return pipeW, nil return pipeW, nil
}, },
}) }, p.platform)
if err != nil { if err != nil {
return st, err return st, err

View File

@ -177,7 +177,7 @@ func (s Solver) forwardEvents(ch chan *bk.SolveStatus) {
// FIXME: this is currently impleneted as a hack, starting a new Build session // FIXME: this is currently impleneted as a hack, starting a new Build session
// within buildkit from the Control API. Ideally the Gateway API should allow to // within buildkit from the Control API. Ideally the Gateway API should allow to
// Export directly. // Export directly.
func (s Solver) Export(ctx context.Context, st llb.State, img *dockerfile2llb.Image, output bk.ExportEntry) (*bk.SolveResponse, error) { func (s Solver) Export(ctx context.Context, st llb.State, img *dockerfile2llb.Image, output bk.ExportEntry, platform specs.Platform) (*bk.SolveResponse, error) {
// Check close event channel and return if we're already done with the main pipeline // Check close event channel and return if we're already done with the main pipeline
select { select {
case <-s.closeCh: case <-s.closeCh:
@ -185,7 +185,7 @@ func (s Solver) Export(ctx context.Context, st llb.State, img *dockerfile2llb.Im
default: default:
} }
def, err := s.Marshal(ctx, st) def, err := s.Marshal(ctx, st, llb.Platform(platform))
if err != nil { if err != nil {
return nil, err return nil, err
} }

View File

@ -252,7 +252,7 @@ setup() {
dagger -e argocd-infra up dagger -e argocd-infra up
# Wait for infra to be ready # Wait for infra to be ready
kubectl -n argocd wait --for=condition=available deployment -l "app.kubernetes.io/part-of=argocd" --timeout=45s kubectl -n argocd wait --for=condition=available deployment -l "app.kubernetes.io/part-of=argocd" --timeout=100s
# Forward port # Forward port
# We need to kill subprocess to avoid infinity loop # We need to kill subprocess to avoid infinity loop