build: use daemon id as worker id for the graph driver controller

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit 6d139e5e95)

# Conflicts:
#	builder/builder-next/controller.go
This commit is contained in:
Kevin Alvarez 2023-05-18 21:17:22 +02:00 committed by CrazyMax
parent cb3fd005d4
commit 276ef743cb
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
4 changed files with 8 additions and 1 deletions

View file

@ -69,6 +69,7 @@ var cacheFields = map[string]bool{
type Opt struct {
SessionManager *session.Manager
Root string
EngineID string
Dist images.DistributionServices
NetworkController libnetwork.NetworkController
ImageTagger containerimageexp.ImageTagger

View file

@ -191,7 +191,7 @@ func newController(rt http.RoundTripper, opt Opt) (*control.Controller, error) {
}
wopt := mobyworker.Opt{
ID: "moby",
ID: opt.EngineID,
ContentStore: store,
CacheManager: cm,
GCPolicy: gcPolicy,

View file

@ -294,6 +294,7 @@ func newRouterOptions(config *config.Config, d *daemon.Daemon) (routerOptions, e
bk, err := buildkit.New(buildkit.Opt{
SessionManager: sm,
Root: filepath.Join(config.Root, "buildkit"),
EngineID: d.ID(),
Dist: d.DistributionServices(),
ImageTagger: d.ImageService(),
NetworkController: d.NetworkController(),

View file

@ -127,6 +127,11 @@ type Daemon struct {
mdDB *bbolt.DB
}
// ID returns the daemon id
func (daemon *Daemon) ID() string {
return daemon.id
}
// StoreHosts stores the addresses the daemon is listening on
func (daemon *Daemon) StoreHosts(hosts []string) {
if daemon.hosts == nil {