Commit Graph

7 Commits

Author SHA1 Message Date
c8c7c1c680 fix: json suffix for json template from CLI (#370) 2022-03-14 09:15:21 -04:00
9ddf110ad6 fix: template apply uses better diff checking (#358)
* fix: template apply uses better diff checking

Previously, we did a DeepEqual of all the returned data about each changed entity,
but due to our template overrides that is not actually all the information
available for each entity. So we marked trivial things as 'conflicts' (e.g.
telegraf config ID's 'changing' from the empty string to the real, current value)
while not catching important conflicts like flux script changes in checks and tasks.

Changes to make things more straightforward:

 * Change the --force behaviour to be more similar to `apt install`, where even
in non-interactive mode `--force yes` is required to bypass the prompt to apply.

  * Before, there were two stages of diff checking - once to print diffs, and once
after the 'Yes/No' prompt. If any conflicts were detected in the second check,
the user got an inscrutable error message that did not highlight what the difference
was or how to force it to apply. `--force conflict` was required to avoid this error.
Instead, we now have simplified to `--force yes` to bypass the 'Yes/No' prompt, and
we never do a second stage of diff checking.

 * Because we do not currently properly account for more complicated diffs (e.g.
flux tasks), we now assume in the diff printing that every object has changes,
except for Labels, Buckets, Variables, and Label Mappings. This could be improved
in the future.

* fix: when statestatus is 'remove', mark as removed
2022-02-04 10:59:02 -05:00
adc58b8441 chore: refactor influxid.ID, cleanup organization checking (#326) 2021-11-10 15:12:59 -06:00
c0103e7b1b build: fix make fmt, reformat test sources (#234) 2021-08-20 15:26:00 -04:00
3ca681b1dd feat: implement template command (#169) 2021-07-02 10:19:51 -04:00
40fc1845e9 feat: port stacks command from influxdb (#168) 2021-06-30 17:21:50 -04:00
fb2d19c884 feat: port table-printers from influxdb (#145) 2021-06-24 11:31:19 -04:00