9 Commits

Author SHA1 Message Date
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
dfc6f00982 fix: less confusing overloads of 'token' in help (#272)
* chore: refactor GetOrg calls

* fix: less confusing overloads of 'token' in help

Closes #20619

* fix: clean up iscommon function definition
2021-09-20 13:57:45 -04:00
bfd929f444 fix: detect non-interactive stdio and use "normal" IO operations (#204) 2021-07-21 17:03:41 -04:00
3ca681b1dd feat: implement template command (#169) 2021-07-02 10:19:51 -04:00
a3f36a9821 feat: port apply command from influxdb (#160) 2021-06-30 14:47:23 -04:00
eb99827966 fix: fix extension-check logic when normalizing github URLs (#158) 2021-06-29 14:49:41 -04:00
7ea63d6a96 fix: add yaml tags to models so we can unmarshal camelCase (#148) 2021-06-28 10:18:41 -04:00
e6d69a8c54 feat: port template-parsing logic from influxdb (#146) 2021-06-24 12:34:13 -04:00