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 21, 2022
1 parent e7b1c26 commit 53b240f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/buildx.ts
Original file line number Diff line number Diff line change
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': {
let platforms: Array<string> = [];
// if a preferred platform is being set then use only these
Expand Down

0 comments on commit 53b240f

Please sign in to comment.