ls: adds fallback if buildkit version info unimplemented

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2022-05-09 16:17:01 +02:00
parent 6e3babc461
commit 57156ee95c
6 changed files with 38 additions and 3 deletions

View File

@ -314,9 +314,10 @@ func loadInfoData(ctx context.Context, d *dinfo) error {
inf, err := c.Info(ctx)
if err != nil {
if st, ok := grpcerrors.AsGRPCStatus(err); ok && st.Code() == codes.Unimplemented {
d.version = "N/A"
} else {
return errors.Wrap(err, "getting info")
d.version, err = d.di.Driver.Version(ctx)
if err != nil {
return errors.Wrap(err, "getting version")
}
}
} else {
d.version = inf.BuildkitVersion.Version