Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cdk-assets): osx cannot publish docker images in parallel #20107

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions packages/cdk-assets/lib/publishing.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AssetManifest, IManifestEntry } from './asset-manifest';
import { AssetManifest, DockerImageManifestEntry, IManifestEntry } from './asset-manifest';
import { IAws } from './aws';
import { IHandlerHost } from './private/asset-handler';
import { makeAssetHandler } from './private/handlers';
Expand Down Expand Up @@ -69,7 +69,18 @@ export class AssetPublishing implements IPublishProgress {
constructor(private readonly manifest: AssetManifest, private readonly options: AssetPublishingOptions) {
this.assets = manifest.entries;
this.totalOperations = this.assets.length;
this.publishInParallel = options.publishInParallel ?? false;

if (process.platform === 'darwin' && this.assets.some(asset => asset instanceof DockerImageManifestEntry)) {
// In OSX, publishing Docker images in parallel exposes a race condition
// in Docker's osxkeychain helper because the helper can't handle
// concurrency, resulting in "delete, delete, add, add" sequences and the
// following error: "The specified item already exists in the keychain."
// So, for OSX, we disable publishing in parallel when a docker image
// asset is present.
this.publishInParallel = false;
} else {
this.publishInParallel = options.publishInParallel ?? false;
}

const self = this;
this.handlerHost = {
Expand Down