Add unit tests for InstanceMetadata
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 65/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- go
- Domain
- cloud, testing-qa
Research direction
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.
Written by the indexing model from the issue text.
Description
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
NodeInternalIPaddresses. - 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
InstanceNetworkInterfaceListandInstanceExternalIpList, asserted witherrors.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.
- Dominant language
- Go
- Stars
- 6
- Forks
- 2
- Avg merge
- 2h 5m
- Merged PRs (30d)
- 14
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from oxidecomputer/oxide-cloud-controller-manager
-
Documentation Kubernetes Cloud Controller Manager (CCM)
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Documentation Kubernetes Cloud Controller Manager (CCM)
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Bug Kubernetes Cloud Controller Manager (CCM)
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Bug Kubernetes Cloud Controller Manager (CCM)
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
oxidecomputer/oxide-cloud-controller-manager#275 · 1 comment ·
-
Enhancement Kubernetes Cloud Controller Manager (CCM)
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
All issues in oxidecomputer/oxide-cloud-controller-manager
Similar issues
-
bug github_actions
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
registrystack/registry-stack#1393 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
JakeChampion/lang#10213 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
oasisprotocol/oasis-sdk#2523 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100