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

Add unit tests for InstanceMetadata

Aperta
#262 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
go
Ambito
cloud, testing-qa

Direzione di ricerca

Read InstanceMetadata in internal/provider/instances_v2.go and inspect the mock rework's parameter-asserting fake style first. Add coverage for each NIC and external-IP shape, hostname, provider ID, instance type, and both InstanceNetworkInterfaceList and InstanceExternalIpList error paths, asserting errors.Is; done means every listed shape and both errors are tested.

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

Descrizione

Kubernetes Cloud Controller Manager (CCM) Testing

Context

InstanceMetadata (internal/provider/instances_v2.go) is the most complex function in InstancesV2 — NIC dual-stack handling, SNAT filtering, external IP mapping, provider ID formatting — and it has zero test coverage today, even though the mock already has fields to fake its inputs.

Scope

Add unit tests covering:

  • v4-only, v6-only, and dual-stack NICs mapping to NodeInternalIP addresses.
  • SNAT external IPs being skipped.
  • Ephemeral and floating external IPs mapping to NodeExternalIP.
  • Hostname address always present.
  • Provider ID formatting (oxide://<uuid>).
  • Instance-type string (<ncpus>-<memory GiB>).
  • Error paths for InstanceNetworkInterfaceList and InstanceExternalIpList, asserted with errors.Is.

Done when

Each NIC/external-IP shape has a test and both error paths are asserted.

Blocked by the mock rework (parameter-asserting fakes) — build these tests on the new fake style.

Lingua principale
Go
Stelle
6
Fork
2
Merge medio
3h
PR unite (30g)
6

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 oxidecomputer/oxide-cloud-controller-manager

Tutte le issue di oxidecomputer/oxide-cloud-controller-manager

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.