Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Pass the image to `ImagePullPolicy.shouldPull`

Aperta
#1,537 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
docker, node.js, typescript
Ambito
backend, devtools

Direzione di ricerca

Start with packages/testcontainers/src/utils/pull-policy.ts, then trace policy use in generic-container.ts, generic-container-builder.ts and docker-compose-environment.ts. Check #1518 for the existing return values before deciding how to handle the compatibility and multiple-image cases. Done means policies receive the relevant image, named outcomes are accepted alongside current values, and the documented call sites handle them consistently.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement minor

What happens

ImagePullPolicy.shouldPull() takes no arguments:

export interface ImagePullPolicy {
  shouldPull(): boolean | "never";
}

A custom policy cannot see which image it is being asked about, so it cannot express rules such as "always pull :latest, use the cache for pinned tags" or "never pull images from the local registry". One policy instance is applied to every image a container, a Dockerfile build or a Compose environment needs.

The return type mixes two booleans with a string: false means "pull if missing", true means "always pull" and "never" means "fail if missing".

Expected

  • shouldPull receives the image, for example shouldPull(image: ImageName).
  • The three outcomes have names, for example "always" | "missing" | "never", accepted alongside the current values.

Where

  • packages/testcontainers/src/utils/pull-policy.ts
  • call sites in generic-container.ts, generic-container-builder.ts and docker-compose-environment.ts

Notes

  • Java's interface is boolean shouldPull(DockerImageName imageName). .NET's policy is a Func<ImageInspectResponse, bool>.
  • Passing an argument is compatible with existing policies, hence minor. Dropping the boolean | "never" return values would be major.
  • Compose and Dockerfile builds resolve several images. Decide what they pass.

Dependencies

  • Nothing blocks this. It can start now.
  • Coordinate with #1518: for the old return values.
Lingua principale
TypeScript
Stelle
2.6k
Fork
274
Merge medio
1g 14h
PR unite (30g)
44

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di testcontainers/testcontainers-node

Tutte le issue di testcontainers/testcontainers-node

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.