Skip to content

Commit

Permalink
Merge pull request #319 from crazy-max/buildx-builder-current
Browse files Browse the repository at this point in the history
buildx: make name opt optional when inspecting builder
  • Loading branch information
crazy-max committed Apr 25, 2024
2 parents 5bbaf90 + f549f79 commit 33688c4
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 33688c4

Please sign in to comment.