Skip to content

Commit

Permalink
resolve linting issues
Browse files Browse the repository at this point in the history
Signed-off-by: Maninderjit Bindra <maninder.bindra@gmail.com>
  • Loading branch information
maniSbindra committed Oct 23, 2023
1 parent c214868 commit d08f39d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/cnab/provider/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ func (r *Runtime) newDriver(driverName string, args ActionArguments) (driver.Dri
if !args.AllowDockerHostAccess && len(args.HostVolumeMounts) == 0 {
driverImpl, err = drivers.LookupDriver(r.Context, driverName)
}
if err != nil {
return nil, err
}

var d *docker.Driver
if args.AllowDockerHostAccess || len(args.HostVolumeMounts) > 0 {
Expand All @@ -52,6 +55,9 @@ func (r *Runtime) newDriver(driverName string, args ActionArguments) (driver.Dri
if args.AllowDockerHostAccess {
driverImpl, err = r.dockerDriverWithHostAccess(dockerExt, d)
}
if err != nil {
return nil, err
}

if len(args.HostVolumeMounts) > 0 {
driverImpl, err = func(dr *docker.Driver) (driver.Driver, error) {
Expand All @@ -66,6 +72,9 @@ func (r *Runtime) newDriver(driverName string, args ActionArguments) (driver.Dri

return driver.Driver(dr), nil
}(d)
if err != nil {
return nil, err
}
}

if configurable, ok := driverImpl.(driver.Configurable); ok {
Expand Down

0 comments on commit d08f39d

Please sign in to comment.