Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exec: check cdi manager not nil #5729

Merged
merged 1 commit into from
Feb 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions solver/llbsolver/ops/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,16 +199,18 @@ func (e *ExecOp) CacheMap(ctx context.Context, g session.Group, index int) (*sol
cm.Deps[i].PreprocessFunc = unlazyResultFunc
}

for _, d := range e.op.CdiDevices {
setup, ok := e.w.CDIManager().OnDemandInstaller(d.Name)
if ok {
prev := cm.Deps[0].PreprocessFunc
cm.Deps[0].PreprocessFunc = func(ctx context.Context, r solver.Result, g session.Group) error {
if err := prev(ctx, r, g); err != nil {
return err
if e.w != nil && e.w.CDIManager() != nil {
for _, d := range e.op.CdiDevices {
setup, ok := e.w.CDIManager().OnDemandInstaller(d.Name)
if ok {
prev := cm.Deps[0].PreprocessFunc
cm.Deps[0].PreprocessFunc = func(ctx context.Context, r solver.Result, g session.Group) error {
if err := prev(ctx, r, g); err != nil {
return err
}
// we could pass glibc/musl type in here based on rootfs to get correct dynamic libs
return setup(ctx)
}
// we could pass glibc/musl type in here based on rootfs to get correct dynamic libs
return setup(ctx)
}
}
}
Expand Down
Loading