fix: stamp uid and creation timestamp on objects the server writes itself - #125
Merged
Merged
Conversation
…self Pools provisioned by a class cascade and the IPAllocation a claim materialises are written straight into the object table, so neither passed through the create path that stamps metadata.uid and metadata.creationTimestamp. Every provisioned pool reported 0001-01-01T00:00:00Z and carried no UID, so nothing could take an owner reference to one. Both write paths now stamp the fields, and migration 005 repairs existing rows: the timestamp comes from the row's own created_at, the UID is generated. The repair is reversioned so watchers see it.
scotwells
requested review from
JoseSzycho,
ecv,
kevwilliams,
mattdjenkinson,
privateip and
savme
September 22, 2026 23:59
scotwells
marked this pull request as ready for review
September 22, 2026 23:59
ecv
approved these changes
Sep 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
kubectl get ippoolsreports0001-01-01T00:00:00Zfor every pool a class provisioned; only the hand-created roots show a real time.Provisioned pools and the
IPAllocationa claim materialises are written straight into the object table rather than POSTed, so neither passed through the create path that stampsmetadata.uidandmetadata.creationTimestamp. The missing UID is the more consequential half: an owner reference names a UID, so nothing could own or be owned by a provisioned pool.Change
Both write paths stamp the fields before the insert.
Migration
005repairs existing rows. The timestamp comes from that row's owncreated_at, so a repaired object says what it would have said at the time; the UID is generated, since nothing references these yet. Rows are reversioned with aMODIFIEDchangelog entry so watches opened before the migration do not keep serving the unstamped object.Left out
Downis a no-op — the migration does not record which document was missing which field, and stripping every UID and timestamp would break the objects that always had them.