chore: Improve test container dx (#16988)

This commit is contained in:
Tomi Turtiainen
2025-07-07 15:08:37 +03:00
committed by GitHub
parent 974a0c1a35
commit 32bb33bd65
3 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import { ImagePullPolicy, PullPolicy } from 'testcontainers';
/**
* Custom pull policy for n8n images:
* - Never try to pull the local image
* - Otherwise, use the default pull policy (pull only if not present)
*/
export class N8nImagePullPolicy implements ImagePullPolicy {
constructor(private readonly image: string) {}
public shouldPull(): boolean {
if (this.image === 'n8nio/n8n:local') {
return false;
}
return PullPolicy.defaultPolicy().shouldPull();
}
}