What's Changed
๐จ Highlights
This release fixes several ways in which IP addresses could leak in Infoblox or be reported wrongly. Claims no longer try to replace an address that was removed in Infoblox. Releases go to the Infoblox instance recorded on the IPAddress. A 404 from a proxy no longer counts as "not found".
Errors from Infoblox now name the endpoint, the operation and the parameters, and are classified into clear condition reasons. Some reasons are renamed or new โ see Upgrade notes.
Upgrade notes
- Drifted addresses are reported, not replaced. Claims whose
IPAddressno longer agrees with Infoblox now showReady=Falsewith the reasonAddressDrifted(before:Ready=Trueplus permanent "IPAddress spec is immutable" errors, and possibly a second address reserved in Infoblox). Repair such claims manually: set the host record back to the address of theIPAddressand remove the extra address, or replace the machine. - Condition reasons changed. Monitoring and alerts must be adapted:
InfobloxCheckFailedis renamed toInfobloxRequestFailedand only used when Infoblox rejected a request with a WAPI error.- Errors without a WAPI response (transport errors, HTTP errors of a proxy, unreadable responses) give the new reason
InfobloxConnectionFailed. - If no Infoblox client can be created, instances, pools and claims show
ConfigurationInvalidinstead ofAuthenticationFailed. - Claims whose subnets are all full show
NoAddressAvailableinstead ofAllocationFailed.
- Invalid TLS configuration is an error. An unreadable or invalid custom CA file no longer silently disables TLS verification, and an invalid client certificate no longer stops the operator. The
InfobloxInstancegetsConfigurationInvalidinstead. - Instances are always checked.
InfobloxInstanceswithout default views wereReady=Truewithout any request. They are now checked against Infoblox and can becomeReady=False, e.g. with wrong credentials. - Releases can now fail where they silently leaked before. A release that gets a 404 without a WAPI error body, or of a claim without the hostname annotation whose pool is gone, now fails with
ReleaseFailedand keeps the finalizer. Restore the pool or set the annotationipam.cluster.x-k8s.io/hostnameto let the deletion proceed.
โจ Features
- feat: add context and classification to Infoblox errors by @Arakos in #180 (
0687211)- Each failed request is a
RequestErrorwith endpoint, operation and parameters. HTTP error responses becomeHTTPError, orWapiErrorif they have a WAPI error body. HTML bodies (e.g. a proxy error page) are not shown. - New classifiers
IsTransportError,IsHTTPError,IsWapiError,IsAuthError.IsNotFoundErrorno longer matches by message text, and only a 404 with a WAPI error body counts as "not found" โ a 404 of a proxy made a release report success while the address stayed in Infoblox. - An empty host record lookup means "no record" instead of "multiple records".
- Each failed request is a
- feat: report a full network as
NoAddressAvailableon the claim by @Arakos in #180 (dbe4c19) - feat: always check the connection of an
InfobloxInstance(WAPI schema request) before the view checks by @Arakos in #180 (f65a94b) - feat: extend the printcolumns of
InfobloxInstanceandInfobloxIPPool(Ready status and reason, message with-o wide, instance of a pool) by @Arakos in #180 (e644b69)
๐ Fixes
- fix: address leaks and drift by @Arakos in #180
- The Infoblox request timeout was
int(time.Second)seconds, about 31 years โ a request without a response could block a worker forever. It is now 30 seconds (972e111) NewClientvalidates the TLS configuration first: a missing or invalid custom CA file, an invalid client certificate/key pair, or a transport without TLS verification is an error (48d7bb4)- Releases use a client for the Infoblox instance recorded on the
IPAddress, not the client of the pool's current instance (31c41ad) - An existing
IPAddressis only verified in Infoblox, never replaced:AddressDrifted,AddressInvalidandVerificationFailedreport the problems. Before a new allocation, theIPAddressis read from the API server, so a stale cache cannot cause a second reservation (0436b61) - A claim without the hostname annotation whose pool is gone no longer guesses its hostname from the claim name; the release fails instead of leaking the address (
01a3702) - A missing
InfobloxInstanceor credentials Secret is no longer mistaken for a missing pool: live claims getConfigurationInvalid, deleted claimsReleaseFailed(6e76a06) - Errors without a WAPI response are reported as
InfobloxConnectionFailed, andInfobloxCheckFailedis renamed toInfobloxRequestFailed(89b5082) - Pools only check the DNS view if they have a
dnsZoneโ only then do their host records use DNS (503c701)
- The Infoblox request timeout was
๐งช Testing & Chores
- test: add unit tests for
pkg/infobloxand move the integration tests by @Arakos in #180 (6317ffb)- Unit tests with generated mocks of the Infoblox API (
ibclientmock);make generatealso generates the mocks, using themockgenversion fromgo.mod - Tests against a live Infoblox instance moved to
test/integration/infobloxbehind the build tagintegration; run them withmake test-integration(renamed frommake test-infoblox) ormake test-all - The linter and
make vetalso examine the integration tests - The README documents the test targets and rules for good tests
- Unit tests with generated mocks of the Infoblox API (
Full Changelog: v0.3.0-rc.1...v0.3.0-rc.2