mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
avoid extra client for history API detection
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
@ -229,17 +229,10 @@ func (d *Driver) Factory() driver.Factory {
|
||||
}
|
||||
|
||||
func (d *Driver) Features(ctx context.Context) map[driver.Feature]bool {
|
||||
var historyAPI bool
|
||||
c, err := d.Client(ctx)
|
||||
if err == nil {
|
||||
historyAPI = driver.HistoryAPISupported(ctx, c)
|
||||
c.Close()
|
||||
}
|
||||
return map[driver.Feature]bool{
|
||||
driver.OCIExporter: true,
|
||||
driver.DockerExporter: d.DockerAPI != nil,
|
||||
driver.CacheExport: true,
|
||||
driver.MultiPlatform: true, // Untested (needs multiple Driver instances)
|
||||
driver.HistoryAPI: historyAPI,
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user