One pass of the Asset controller. Each exit sets Materialized to False and records an event.
Read the Asset. If it is gone or has a deletion timestamp, stop. Garbage collection removes the endpoint, because the Asset owns it.
If spec.bmcMac is empty, set Materialized to False with the reasonNoBMCMac.
Find the MAC in the ledger. If the ledger skipped the line for this MAC, the reason is LedgerEntryInvalid. If the MAC is not in the ledger, the reason is NoLedgerEntry.
Create or update the endpoint with the same name as the Asset. The spec gets the address from the ledger, the credentialsRef from the Asset and the TLS policy from the manager flags.
Set the owner reference to the Asset and set Materialized to True.
The manager reads the ledger file at start. After you edit the ledger ConfigMap, restart the Deployment. The message of NoLedgerEntry gives the command.
An event only on change
The controller records a Warning event only when the reason or the message of Materialized changes. The condition stays; the event is for people who watch events.
No fight over a name
If an endpoint with the same name belongs to another Asset, the controller does not change it. It sets MaterializeConflict.