Skip to content

Commit

Permalink
return driver opts and buildkit version from nodes metadata
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max committed Sep 18, 2022
1 parent 2e7d20a commit 0889ea4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/buildx.ts
Expand Up @@ -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;
};

Expand Down Expand Up @@ -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;
Expand All @@ -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': {
node.platforms = value.replace(/\s/g, '');
break;
Expand Down

0 comments on commit 0889ea4

Please sign in to comment.