Skip to content

Commit

Permalink
Merge pull request #51 from crazy-max/fix-docker-exporter
Browse files Browse the repository at this point in the history
buildx: fix docker exporter check
  • Loading branch information
crazy-max committed Feb 20, 2023
2 parents d153cfa + 1acd6c2 commit 1383a2b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions __tests__/buildx/inputs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ describe('hasDockerExporter', () => {
[['type=docker', 'type=tar,dest=/tmp/image.tar'], true, undefined],
[['"type=tar","dest=/tmp/image.tar"'], false, undefined],
[['" type= local" , dest=./release-out'], false, undefined],
[['type=docker'], true, false],
[['type=docker'], true, true],
[['.'], true, true],
])('given %p returns %p', async (exporters: Array<string>, expected: boolean, load: boolean | undefined) => {
expect(Inputs.hasDockerExporter(exporters, load)).toEqual(expected);
Expand Down
2 changes: 1 addition & 1 deletion src/buildx/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export class Inputs {
}

public static hasDockerExporter(exporters: string[], load?: boolean): boolean {
return load ?? Inputs.hasExporterType('docker', exporters);
return load || Inputs.hasExporterType('docker', exporters);
}

public static hasExporterType(name: string, exporters: string[]): boolean {
Expand Down

0 comments on commit 1383a2b

Please sign in to comment.