Skip to content

Commit

Permalink
buildx: make name opt optional when inspecting builder
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max committed Apr 25, 2024
1 parent 5bbaf90 commit f549f79
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/buildx/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class Builder {
return ok;
}

public async inspect(name: string): Promise<BuilderInfo> {
public async inspect(name?: string): Promise<BuilderInfo> {
// always enable debug for inspect command, so we can display additional
// fields such as features: https://github.com/docker/buildx/pull/1854
const envs = Object.assign({}, process.env, {
Expand All @@ -64,7 +64,12 @@ export class Builder {
[key: string]: string;
};

const cmd = await this.buildx.getCommand(['inspect', name]);
const args = ['inspect'];
if (name) {
args.push(name);
}

const cmd = await this.buildx.getCommand(args);
return await Exec.getExecOutput(cmd.command, cmd.args, {
ignoreReturnCode: true,
silent: true,
Expand Down

0 comments on commit f549f79

Please sign in to comment.