Copy passed hash before manipulating it.
Assigning to the same hash object will break href-to
because in certain scenarios href-to-helper will
not create a new object that gets passed to
`fsm-with-optional`-hrefTo method.
This is problematic for optional route-params, and lead
to a situation where links to peered services would
create the wrong url for their href-attribute.
We need to explicitly tell the UI to not show the bucket-list
when we are displaying imported services. If we make
this depend on the data we will sometimes not show
it due to data-loader caching.
Working with a peer model as a relationship is much
easier than to workaround a non-relationship in
imported services. This is currently only relevant
for imported-services where we know the peer
in advance.
Add a helper that knows how to format past dates
in a smart way. When less than a week ago we will
use relative date strings - for dates older than a week
we will use a friendly human-readable format.
This matches best practices we want to adhere to
based on what Terraform did for date-formatting.
To measure the available space of an element when it
should take up the "rest" of the page. This matches
what `ListCollection` is doing internally but makes
the mechanism available in a composable component.
memdb's `WatchCh` method creates a goroutine that will publish to the
returned channel when the watchset is triggered or the given context
is canceled. Although this is called out in its godoc comment, it's
not obvious that this method creates a goroutine who's lifecycle you
need to manage.
In the xDS capacity controller, we were calling `WatchCh` on each
iteration of the control loop, meaning the number of goroutines would
grow on each autopilot event until there was catalog churn.
In the catalog config source, we were calling `WatchCh` with the
background context, meaning that the goroutine would keep running after
the sync loop had terminated.