bake: fix undefined output property

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2023-03-26 19:26:59 +02:00
parent d0929eeb16
commit a7448298e0
7 changed files with 89 additions and 19 deletions

View File

@@ -84,7 +84,9 @@ export class Bake {
const exporters = new Array<string>();
for (const key in def.target) {
const target = def.target[key];
exporters.push(...target.output);
if (target.output) {
exporters.push(...target.output);
}
}
return exporters;
}

View File

@@ -24,22 +24,22 @@ export interface Group {
}
export interface Target {
args: Record<string, string>;
attest: Array<string>;
'cache-from': Array<string>;
'cache-to': Array<string>;
args?: Record<string, string>;
attest?: Array<string>;
'cache-from'?: Array<string>;
'cache-to'?: Array<string>;
context: string;
contexts: Record<string, string>;
contexts?: Record<string, string>;
dockerfile: string;
'dockerfile-inline': string;
labels: Record<string, string>;
'no-cache': boolean;
'no-cache-filter': Array<string>;
output: Array<string>;
platforms: Array<string>;
pull: boolean;
secret: Array<string>;
ssh: Array<string>;
tags: Array<string>;
target: string;
'dockerfile-inline'?: string;
labels?: Record<string, string>;
'no-cache'?: boolean;
'no-cache-filter'?: Array<string>;
output?: Array<string>;
platforms?: Array<string>;
pull?: boolean;
secret?: Array<string>;
ssh?: Array<string>;
tags?: Array<string>;
target?: string;
}