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

Provide in-network connection details from modules

Aperta
#1,567 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
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
docker, node.js, typescript
Ambito
databases, testing

Direzione di ricerca

Start with #1536 for network alias support and coordinate the getter name with #1538. Read the alias code in packages/testcontainers/src/test-container.ts and started-generic-container.ts, then inspect connection getters under packages/modules/*/src and the in-network listener approaches in Kafka and Redpanda. Done means modules can provide a URI using a network alias and internal port, with credentials and database name from module configuration.

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

Descrizione

enhancement minor

What happens

Module getters return the address as seen from the test process: the Docker host and a mapped port. A second container on the same Docker network needs a different address, the first container's network alias and its internal port, and no module provides it.

const db = await new PostgreSqlContainer(image).withNetwork(network).withNetworkAliases("db").start();

db.getConnectionUri(); // postgres://test:test@localhost:55012/test, no use to another container

const app = await new GenericContainer(appImage)
  .withNetwork(network)
  .withEnvironment({ DATABASE_URL: "postgres://test:test@db:5432/test" }) // assembled by hand
  .start();

The module knows the internal port, the credentials and the database name. The user has to repeat all of them, and keep them in step with the module's defaults.

Expected

Each module can produce its connection details for use inside a network:

db.getConnectionUri({ network }); // postgres://test:test@db:5432/test

A started container can report its aliases on a network, which this needs.

Where

  • packages/testcontainers/src/test-container.ts and started-generic-container.ts, for the aliases
  • the connection getters in packages/modules/*/src

Notes

  • Kafka and Redpanda already have to deal with in-network listeners. Their approach is a starting point.
  • The naming should follow whatever the modules converge on for connection getters.

Dependencies

  • Blocked by #1536: needs a started container to know its aliases on a network.
  • Coordinate with #1538: for the getter name.
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.