Skip to content

Answer the open API questions against a real tenant - #11

Merged
IngmarVG-IB merged 2 commits into
mainfrom
IngmarVG-IB/openshift
Nov 30, 2026
Merged

IngmarVG-IB merged 2 commits into
mainfrom
IngmarVG-IB/openshift

Conversation

@IngmarVG-IB

Copy link
Copy Markdown
Owner

The operator's next-available allocation depends on a Universal DDI API form the CSP API reference doesn't document. This records that, then settles every verify item in the API notes against a real tenant (2026-11-30).

Next-available is undocumented. Every next-available create puts <parent id>/nextavailableip, /nextavailablesubnet or /nextavailableaddressblock in the address field of a normal create. The API reference describes address only as a.b.c.d or a.b.c.d/n. The Infoblox Terraform provider and Ansible collection rely on the same form. The documented next-available endpoints can't replace it because none of them takes tags, and a two-call create can leak an untagged object. This is now open question 9 in DESIGN.md and Open questions 1 in docs/uddi-api-notes.md, and has been raised with Infoblox product management.

What the tenant run settled:

Item Result
Next-available, all three forms Work sequentially and keep the tags sent in the same body
Concurrent next-available 8 independent clients on one subnet: 4 got distinct addresses, 4 got HTTP 400 The address … already exists. No duplicates
Tag PATCH Replaces the map, so tag removal works
_limit / _offset No cap below 1000; offset paging has no gaps or overlap
Duplicate create HTTP 409, body {"error":[{"message": ...}]}
Recycle bin A deleted IPSpace or View drops out of natural-key lookups, and the name is reusable at once
Option code ids dhcp/option_code/<uuid> and dhcp/option_space/<uuid>, as assumed
Dedicated next-available path Takes the bare uuid or the prefixed id

The concurrency result changes why the per-parent mutex exists. The API never hands out a duplicate. It gives racing callers the same candidate and fails all but the first, so the mutex saves failed requests rather than preventing duplicates. Across processes the operator still gets the 400. It reports APIError, retries with backoff and picks a new address.

Tests. test/integration/openquestions_test.go adds the four checks that had no test: the address block form, concurrent clients (each with its own client, so the operator's mutex doesn't serialise them), _limit/_offset, and the dedicated endpoint's path parameter. test/integration/bearer_test.go lets the suite run on the JWT of an interactive portal login (UDDI_BEARER_TOKEN) as well as an API key. It swaps the header for the suite's own requests only, and the deliberate bad-key test is left alone.

Verification. make test-integration against a real tenant: 26 tests, all pass in 76 s. Afterwards no object carrying the run's tag was left in the tenant. go vet -tags integration ./test/integration/... is clean. No operator code changes.

🤖 Generated with Claude Code

The CSP API reference describes the address field only as a.b.c.d or
a.b.c.d/n, yet every next-available create puts a parent id plus a
nextavailable suffix there. Add it as an open question in
docs/uddi-api-notes.md and DESIGN.md section 14, with why the documented
next-available endpoints cannot replace it (no tags, so a two-call create
can leak an untagged object) and the missing concurrency guarantee.

Also correct the notes: the nextavailablesubnet and
nextavailableaddressblock endpoints take cidr, count, name and comment,
not only count and contiguous.
Ran the integration suite against a tenant on 2026-11-30 and wrote the
verdicts back: every **verify** item in docs/uddi-api-notes.md is now
settled, and DESIGN.md open questions 6, 7 and 8 are resolved.

New tests in test/integration/openquestions_test.go cover what had none:
the nextavailableaddressblock form, concurrent next-available creates from
independent clients, whether _limit is capped and _offset pages cleanly,
and the path parameter of the dedicated next-available endpoints.

The concurrency result changes the reasoning behind the per-parent mutex.
With 8 clients racing for one subnet, 4 got distinct addresses and 4 failed
with HTTP 400 "already exists". The API never hands out a duplicate, but it
gives racing callers the same candidate and fails all but the first. That
and the missing tags on the documented next-available endpoints are raised
with Infoblox product management.

The suite can now run on the JWT of an interactive portal login
(UDDI_BEARER_TOKEN) as well as an API key; bearer_test.go swaps the
header for the suite's own requests only.
@IngmarVG-IB
IngmarVG-IB merged commit 404f79b into main Nov 30, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant