buildx: make name opt optional when inspecting builder
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -55,7 +55,7 @@ export class Builder {
|
|||||||
return ok;
|
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
|
// always enable debug for inspect command, so we can display additional
|
||||||
// fields such as features: https://github.com/docker/buildx/pull/1854
|
// fields such as features: https://github.com/docker/buildx/pull/1854
|
||||||
const envs = Object.assign({}, process.env, {
|
const envs = Object.assign({}, process.env, {
|
||||||
@@ -64,7 +64,12 @@ export class Builder {
|
|||||||
[key: string]: string;
|
[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, {
|
return await Exec.getExecOutput(cmd.command, cmd.args, {
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
silent: true,
|
silent: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user