avoid extra client for history API detection

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi
2023-06-12 17:39:09 -07:00
parent 2c02db8db4
commit 1138789f20
10 changed files with 19 additions and 37 deletions

View File

@ -64,7 +64,7 @@ type Driver interface {
Config() InitConfig
}
func Boot(ctx, clientContext context.Context, d Driver, pw progress.Writer) (*client.Client, error) {
func Boot(ctx, clientContext context.Context, d *DriverHandle, pw progress.Writer) (*client.Client, error) {
try := 0
for {
info, err := d.Info(ctx)
@ -92,7 +92,7 @@ func Boot(ctx, clientContext context.Context, d Driver, pw progress.Writer) (*cl
}
}
func HistoryAPISupported(ctx context.Context, c *client.Client) bool {
func historyAPISupported(ctx context.Context, c *client.Client) bool {
cl, err := c.ControlClient().ListenBuildHistory(ctx, &controlapi.BuildHistoryRequest{
ActiveOnly: true,
Ref: "buildx-test-history-api-feature", // dummy ref to check if the server supports the API