8000 CDI: follow-up refactors · Issue #49993 · moby/moby · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
CDI: follow-up refactors #49993
Open
@thaJeztah

Description

@thaJeztah

Description

Some follow-up work identified in #49990

Change looks good to me; we should probably look at rolling this into daemon.NewDaemon, as there's some validation and setup steps being performed in that function as well (and possibly adjusting of config options), so possibly this should go after that;

moby/daemon/daemon.go

Lines 763 to 78 7BBC 3 in b87aecc

func NewDaemon(ctx context.Context, config *config.Config, pluginStore *plugin.Store, authzMiddleware *authorization.Middleware) (_ *Daemon, retErr error) {
// Verify platform-specific requirements.
// TODO(thaJeztah): this should be called before we try to create the daemon; perhaps together with the config validation.
if err := checkSystem(); err != nil {
return nil, err
}
registryService, err := registry.NewService(config.ServiceOptions)
if err != nil {
return nil, err
}
// Ensure that we have a correct root key limit for launching containers.
if err := modifyRootKeyLimit(); err != nil {
log.G(ctx).Warnf("unable to modify root key limit, number of containers could be limited by this quota: %v", err)
}
// Ensure we have compatible and valid configuration options
if err := verifyDaemonSettings(config); err != nil {
return nil, err
}

and

For a follow up -- perhaps we should consider a centralized function to register all available device drivers. Currently it's a bit inconsistent because the nvidia driver initializes itself via func init and the CDI is registered manually (because it needs a feature flag check).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0