return driver opts and buildkit version from nodes metadata

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2022-09-18 02:16:17 +02:00
parent aa0df6f73a
commit 69d3837448
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7

View file

@ -18,8 +18,10 @@ export type Builder = {
export type Node = { export type Node = {
name?: string; name?: string;
endpoint?: string; endpoint?: string;
'driver-opts'?: Array<string>;
status?: string; status?: string;
'buildkitd-flags'?: string; 'buildkitd-flags'?: string;
buildkit?: string;
platforms?: string; platforms?: string;
}; };
@ -133,6 +135,10 @@ export async function inspect(name: string, standalone?: boolean): Promise<Build
node.endpoint = value; node.endpoint = value;
break; break;
} }
case 'driver options': {
node['driver-opts'] = (value.match(/(\w+)="([^"]*)"/g) || []).map(v => v.replace(/^(.*)="(.*)"$/g, '$1=$2'));
break;
}
case 'status': { case 'status': {
node.status = value; node.status = value;
break; break;
@ -141,6 +147,10 @@ export async function inspect(name: string, standalone?: boolean): Promise<Build
node['buildkitd-flags'] = value; node['buildkitd-flags'] = value;
break; break;
} }
case 'buildkit': {
node.buildkit = value;
break;
}
case 'platforms': { case 'platforms': {
let platforms: Array<string> = []; let platforms: Array<string> = [];
// if a preferred platform is being set then use only these // if a preferred platform is being set then use only these