influx-cli
influx-cli copied to clipboard
Support diff printing of complicated entities in `template apply`
If we re-apply a template, it is difficult to know whether existing objects in the template are changing or not.
This is especially difficult for e.g.:
-
check
entities that have alast updated
field: should changing the last update time count as an update? Currently the database does change the last update time even if nothing else is changing, will that remain the same in the future? - anything that contains a flux script (tasks, checks, dashboards) - normalizing the flux script to match what is stored in the database is somewhat difficult and would ned to account for database versions.
The goal of this issue is to properly inform the user whether these complicated objects will change during template application, or whether template application is a no-op for that entity. Currently for complicated entities the CLI assumes that applying them is never a no-op (see also https://github.com/influxdata/influx-cli/pull/358) .
I think this would require an API change for the database to be more clear during the dry run apply which entities are actually changing vs which entities are remaining unchanged, possibly with a StateStatus = "unchanged"
on the returned diff. The CLI would also have to be updated to properly recognise the new StateStatus.