mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
driver: check history capability
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
@ -88,11 +88,19 @@ func (d *Driver) Client(ctx context.Context) (*client.Client, error) {
|
||||
}
|
||||
|
||||
func (d *Driver) Features() map[driver.Feature]bool {
|
||||
var historyAPI bool
|
||||
ctx := context.Background()
|
||||
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: true,
|
||||
driver.CacheExport: true,
|
||||
driver.MultiPlatform: true,
|
||||
driver.HistoryAPI: historyAPI,
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user