mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update buildkit to c78f696
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
40
vendor/github.com/moby/buildkit/client/info.go
generated
vendored
Normal file
40
vendor/github.com/moby/buildkit/client/info.go
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
controlapi "github.com/moby/buildkit/api/services/control"
|
||||
apitypes "github.com/moby/buildkit/api/types"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
type Info struct {
|
||||
BuildkitVersion BuildkitVersion
|
||||
}
|
||||
|
||||
type BuildkitVersion struct {
|
||||
Package string
|
||||
Version string
|
||||
Revision string
|
||||
}
|
||||
|
||||
func (c *Client) Info(ctx context.Context) (*Info, error) {
|
||||
res, err := c.controlClient().Info(ctx, &controlapi.InfoRequest{})
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "failed to call info")
|
||||
}
|
||||
return &Info{
|
||||
BuildkitVersion: fromAPIBuildkitVersion(res.BuildkitVersion),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func fromAPIBuildkitVersion(in *apitypes.BuildkitVersion) BuildkitVersion {
|
||||
if in == nil {
|
||||
return BuildkitVersion{}
|
||||
}
|
||||
return BuildkitVersion{
|
||||
Package: in.Package,
|
||||
Version: in.Version,
|
||||
Revision: in.Revision,
|
||||
}
|
||||
}
|
18
vendor/github.com/moby/buildkit/client/workers.go
generated
vendored
18
vendor/github.com/moby/buildkit/client/workers.go
generated
vendored
@ -13,10 +13,11 @@ import (
|
||||
|
||||
// WorkerInfo contains information about a worker
|
||||
type WorkerInfo struct {
|
||||
ID string `json:"id"`
|
||||
Labels map[string]string `json:"labels"`
|
||||
Platforms []ocispecs.Platform `json:"platforms"`
|
||||
GCPolicy []PruneInfo `json:"gcPolicy"`
|
||||
ID string `json:"id"`
|
||||
Labels map[string]string `json:"labels"`
|
||||
Platforms []ocispecs.Platform `json:"platforms"`
|
||||
GCPolicy []PruneInfo `json:"gcPolicy"`
|
||||
BuildkitVersion BuildkitVersion `json:"buildkitVersion"`
|
||||
}
|
||||
|
||||
// ListWorkers lists all active workers
|
||||
@ -36,10 +37,11 @@ func (c *Client) ListWorkers(ctx context.Context, opts ...ListWorkersOption) ([]
|
||||
|
||||
for _, w := range resp.Record {
|
||||
wi = append(wi, &WorkerInfo{
|
||||
ID: w.ID,
|
||||
Labels: w.Labels,
|
||||
Platforms: pb.ToSpecPlatforms(w.Platforms),
|
||||
GCPolicy: fromAPIGCPolicy(w.GCPolicy),
|
||||
ID: w.ID,
|
||||
Labels: w.Labels,
|
||||
Platforms: pb.ToSpecPlatforms(w.Platforms),
|
||||
GCPolicy: fromAPIGCPolicy(w.GCPolicy),
|
||||
BuildkitVersion: fromAPIBuildkitVersion(w.BuildkitVersion),
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user