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

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