mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
20 lines
511 B
TypeScript
20 lines
511 B
TypeScript
import type { ImagePullPolicy } from 'testcontainers';
|
|
import { 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) {}
|
|
|
|
shouldPull(): boolean {
|
|
if (this.image === 'n8nio/n8n:local') {
|
|
return false;
|
|
}
|
|
|
|
return PullPolicy.defaultPolicy().shouldPull();
|
|
}
|
|
}
|