mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-18 09:17:49 +08:00
detect moby worker supports multiplatform feature through containerd snapshotter
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
17dc0e1108
commit
1d8db8a738
@ -54,11 +54,22 @@ func (d *Driver) Client(ctx context.Context) (*client.Client, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (d *Driver) Features() map[driver.Feature]bool {
|
func (d *Driver) Features() map[driver.Feature]bool {
|
||||||
|
var useContainerdSnapshotter bool
|
||||||
|
ctx := context.Background()
|
||||||
|
c, err := d.Client(ctx)
|
||||||
|
if err == nil {
|
||||||
|
workers, _ := c.ListWorkers(ctx)
|
||||||
|
for _, w := range workers {
|
||||||
|
if _, ok := w.Labels["org.mobyproject.buildkit.worker.snapshotter"]; ok {
|
||||||
|
useContainerdSnapshotter = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return map[driver.Feature]bool{
|
return map[driver.Feature]bool{
|
||||||
driver.OCIExporter: false,
|
driver.OCIExporter: false,
|
||||||
driver.DockerExporter: false,
|
driver.DockerExporter: false,
|
||||||
driver.CacheExport: false,
|
driver.CacheExport: false,
|
||||||
driver.MultiPlatform: false,
|
driver.MultiPlatform: useContainerdSnapshotter,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user