mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-15 16:07:11 +08:00
avoid extra client for history API detection
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
@ -60,7 +60,6 @@ func (d *Driver) Client(ctx context.Context) (*client.Client, error) {
|
||||
|
||||
func (d *Driver) Features(ctx context.Context) map[driver.Feature]bool {
|
||||
var useContainerdSnapshotter bool
|
||||
var historyAPI bool
|
||||
c, err := d.Client(ctx)
|
||||
if err == nil {
|
||||
workers, _ := c.ListWorkers(ctx)
|
||||
@ -69,7 +68,6 @@ func (d *Driver) Features(ctx context.Context) map[driver.Feature]bool {
|
||||
useContainerdSnapshotter = true
|
||||
}
|
||||
}
|
||||
historyAPI = driver.HistoryAPISupported(ctx, c)
|
||||
c.Close()
|
||||
}
|
||||
return map[driver.Feature]bool{
|
||||
@ -77,7 +75,6 @@ func (d *Driver) Features(ctx context.Context) map[driver.Feature]bool {
|
||||
driver.DockerExporter: useContainerdSnapshotter,
|
||||
driver.CacheExport: useContainerdSnapshotter,
|
||||
driver.MultiPlatform: useContainerdSnapshotter,
|
||||
driver.HistoryAPI: historyAPI,
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user