Commit Graph

35 Commits

Author SHA1 Message Date
5c7c34f16d feat: replication bucket name (#440)
* chore: gofmt

* chore: update openapi gen files

* feat: add replication-bucket-name flag

* fix: fix tests

* chore: rename to replication-bucket

* feat: show remote bucket name or id

* chore: fmt fixup

* chore: update openapi to master

* chore: fix openapi generation
2022-08-18 14:21:50 -04:00
da2899d71d feat: add skipRowOnError handling for raw line protocol files (#419)
* feat: add skipRowOnError for raw line protocol files

* use common code from influxdb instead of copying

* add test

* remove dead code comment
2022-07-01 10:14:14 -06:00
35279515e9 build: upgrade to Go 1.18.1 (#373) 2022-04-13 15:50:35 -05:00
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
7af0b2ae73 feat: enhanced error messages for cloud and oss specific commands (#347)
* feat: enhanced error messages for cloud and oss specific commands

* chore: rename test
2021-12-28 10:03:29 -05:00
13d0827815 fix: duration parser shows duration missing units on error (#348) 2021-12-23 15:06:29 -05:00
adc58b8441 chore: refactor influxid.ID, cleanup organization checking (#326) 2021-11-10 15:12:59 -06:00
857e2b356c chore: expose tabwriter so InfluxDB can use it (#295) 2021-10-06 11:27:25 -04:00
7de3681224 build: upgrade to go1.17 (#251) 2021-09-01 14:11:15 -04:00
fa12328714 fix: detect and error out on incorrect positional args (#236) 2021-08-20 17:30:30 -04:00
c0103e7b1b build: fix make fmt, reformat test sources (#234) 2021-08-20 15:26:00 -04:00
d615694ee9 refactor: replace uses of ioutil with io and os (#223) 2021-08-04 14:45:22 -04:00
bfd929f444 fix: detect non-interactive stdio and use "normal" IO operations (#204) 2021-07-21 17:03:41 -04:00
a111d83b5a fix: retry password-prompt if 2nd entry doesn't match the 1st (#203) 2021-07-21 12:23:39 -04:00
68cfff003a refactor: move duration package out of internal (#202) 2021-07-21 11:52:21 -04:00
c3feea5900 feat: update restore to support InfluxDB 2.0.x (#185) 2021-07-09 15:36:44 -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
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
ead44e4e83 fix: downgrade urfave/cli to v1 to enable more flexible parsing (#154) 2021-06-28 14:49:26 -04:00
e6d69a8c54 feat: port template-parsing logic from influxdb (#146) 2021-06-24 12:34:13 -04:00
fb2d19c884 feat: port table-printers from influxdb (#145) 2021-06-24 11:31:19 -04:00
8972d23024 feat: port jsonnet decoder from influxdb (#143) 2021-06-23 13:37:46 -04:00
a3408e031a chore: refactor password code for StdIO (#139) 2021-06-22 15:34:38 -05:00
23e73e9146 feat: reimplement influx secret CLI command (#125)
* refactor: rename `getPassword` to `getSecret`
2021-06-21 13:33:51 -05:00
581daaa5ba build: run tests natively on ARM, Mac, and Windows in CI (#111) 2021-06-14 10:36:35 -04:00
b1ba53bae2 refactor: move request-compression out of codegen, avoid some buffering (#118) 2021-06-11 16:01:34 -04:00
1c2f61f5ca feat(write): warn about standalone CR characters in header lines (#109)
* feat(write): warn about standalone CR characters in header lines

* feat(write): add test for Windows CRLF line endings

* chore: improve warning message

Co-authored-by: Daniel Moran <danxmoran@gmail.com>

* chore: update test with a new warning message

Co-authored-by: Daniel Moran <danxmoran@gmail.com>
2021-06-07 14:59:57 +02:00
9747d05ae1 refactor: expose generated code and client business logic to share with Kapacitor (#103)
* refactor: take clients out of internal

* refactor: move stdio to pkg

* Move internal/api to api

* refactor: final changes for Kapacitor to access shared functionality

* chore: regenerate mocks

* fix: bad automated refactor

* chore: extra formatting not caught by make fmt
2021-05-25 10:05:01 -04:00
6a9f17d100 feat: add formatted output to influx query (#87) 2021-05-13 10:54:45 -04:00
3414e1a983 refactor: Move from global state to functions (#53)
This commit represents a few experiments of features I've used in Cobra

1. Uses cli.GenericFlag to encapsulate parsing and validation of flag
   values at parse time. This removes the burden from the individual
   CLI commands to parse and validate args and options.

2. Add influxid.ID that may be used by any flag that requires an
   Influx ID. influxid.ID parses and validates string value is a valid
   ID, removing this burden from individual commands and ensuring valid
   values before the command actions begins.

3. Binds cli.Flags directly to params structures to directly capture
   the values when parsing flags.

4. Moves from global state to local builder functions for the majority
   of the commands. This allows the commands to bind to flag variables
   reducing the repeated ctx.String(), ctx.Int(), etc

5. Leverages the BeforeFunc to create middleware and inject the CLI and
   API client into commands, saving the repeated boilerplate across
   all of the instantiated commands. This is extensible, so additional
   middleware can be appends using the middleware.WithBeforeFns
2021-05-03 09:31:45 -04:00
7d6ea73c33 feat: use signal-wrapped contexts in CLI commands (#38) 2021-04-26 09:51:15 -04:00
f2d10e34f9 feat: port csv2lp from influxdb (#37)
Co-authored-by: William Baker <55118525+wbaker85@users.noreply.github.com>
2021-04-26 09:12:29 -04:00