When checking for existing configs, check the length of the array after
parsing. There could be an empty config file present.
If --name was specified then use that as the configuration name, regardless of
whether or not there are existing configs.
Allow a 0 (infinite) retention to be specified with --retention when in
interactive mode.
Co-authored-by: Dan Moran <dmoran@influxdata.com>
This package provides essentially the same API as the Cloud tests
package, utilising the `TestLauncher` type.
Additional With functional options were added to the `Launcher`
in order to expose type-safe configuration of InfluxQL configuration.
Additional With options may be added in the future as the need arises.
This includes removal of a lot of kv.Service responsibilities. However,
it does not finish the re-wiring. It removes documents, telegrafs,
notification rules + endpoints, checks, orgs, users, buckets, passwords,
urms, labels and authorizations. There are some oustanding pieces that
are needed to get kv service compiling (dashboard service urm
dependency). Then all the call sites for kv service need updating and
the new implementations of telegraf and notification rules + endpoints
needed installing (along with any necessary migrations).
This resolves observed race conditions when running test suites that
utilize the launcher. It also reduces test times considerably, by
eliminating a slow loop to find a port.
The enhancements and fixes to the user experience are as follows:
* Rename active and inactive commands to the actions set-active and
set-inactive respectively to clarify their behavior
To set a token to active:
```
influx v1 auth set-active
```
To set a token to inactive, preventing its use:
```
influx v1 auth set-inactive
```
* allow `--id` or `--username` anywhere a single authentication token is
required
* use separate vars to store the flag state of each command
* factor out the behavior to find a single authentication token into
a shared function, `v1FindOneAuthorization`
A static initialization is not desirable in the main binaries, as it forces all
paths of code to init, but it is still useful in tests. It allows static
intialization to be performed once for all tests and eliminates the need to
always add the FluxInit call. Added a fluxinit/static package that calls
fluxinit.FluxInit() to replace the builtin package. This hides the nature of
the initialization and makes it clear that it is mandatory initialization code
getting called.
feat(dashboard): add owner ID to dashboard model
This adds the explicit OwnerID field to Dashboard and also adds a
migration which populates dashboard owners IDs based on dashboard owner
URMs.
feat(dashboards): isolate service in own package
This change isolates the dashboards service into its own package. It
also updates the API to no longer interface with user resource mappings.
Instead it defines new handlers which rely on the newly populated owner
ID field.
chore(dashboards): port tests from http package into new service transport package
chore(launcher): use dashboard transport package client in launcher tests
chore(kv): remove now defunkt dashboard service implementations