Merge pull request #45559 from crazy-max/23.0_backport_fix-worker-id

[23.0 backport] build: use daemon id as worker id for the graph driver controller
This commit is contained in:
Bjorn Neergaard 2023-05-19 09:44:25 -06:00 committed by GitHub
commit e017245c34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 {