To uncouple from the core.Cluster structure, this uses a callback to learn about which resources exist and which units they use.
I also used the opportunity to refactor out the innermost loop into a helper function for readability.
Because this is below go-bits, any go-bits APIs were replaced by their std equivalents (in the case of errext.ErrorSet -> []error) or replaced with a simple inline implementation (in the case of assert.DeepEqual).
I want to reuse this in limesctl for CI-level validation of quota-overrides.json files.
This slightly differs from the existing implementation in Limes core:
core.Cluster
structure, this uses a callback to learn about which resources exist and which units they use.errext.ErrorSet -> []error
) or replaced with a simple inline implementation (in the case ofassert.DeepEqual
).