Commit Graph
13 Commits
Author SHA1 Message Date
Forrest Marshall ecef3465b6 instance heartbeats 2022-12-30 12:09:11 -08:00
Vitor Enes 5a4e67027c Improve tsh play JSON & YAML output (#18768)
Before this commit, events in the output of `tsh play --format=yaml` were
separated by a newline. This commit ensures that these events are now
separated by `---`, allowing the command output to play well with `yq`.

For consistency, the output of `tsh play --format=yaml <session-id>`
now mirrors what we get e.g. with `tctl nodes ls --format=yaml`.
The same applies to `tsh play --format json`.
2022-11-28 19:36:04 +00:00
Jakub Nyckowski 0ee91f6c37 Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
Noah Stride 02b4f8575f Configure linter to catch British 🇬🇧 spellings 🇺🇸 🦅 📖 (#14363)
* configure golangci-lint misspell to check for anglicized spellings

* Americanize spellings

* fix aws constant value with british spelling 🇬🇧

* update api types with americanized spellings

* use american spellings .cloudbuild/scripts
2022-07-14 10:51:23 +00:00
Andrew Burke 7c81fc9d98 Add JSON and YAML to several tsh commands (#11681)
This PR adds support for JSON and YAML output to several tsh commands via the --format flag.
2022-04-18 21:40:28 +00:00
Tim Buckley f216605ae9 Enable map key sorting in utils.FastMarshal (#10070)
* Enable map key sorting in `utils.FastMarshal`

This enables map key sorting during JSON serialization to ensure
`CompareAndSwap` opertions work consistently if the resource in
question has embedded map values (e.g. labels).

Note that this is hypothetically a breaking change: it makes
comparisons consistent, so if it saves a variant that consistently
fails a `CompareAndSwap()`, it will... fail consistently rather
than sometimes work. In practice, today only `CertificateAuthority`
resources use `CompareAndSwap()` and under normal circumstances they
never have labels attached.

In the unlikely event that some resource is affected, a load/store
should save it with sorted key ordering and fix the problem.

* Log a warning if CAs fail a compare-and-swap with multiple labels

This attempts to mitigate compare-and-swap failures if CAs have
multiple labels by logging a warning instructing users to re-save
their CertificateAuthority resource.

* Fix copied comment typo and make the logged warning actionable

* Fix log.Warn() call with formatting directives
2022-02-07 23:32:58 +00:00
Brian Joerger ce87251ea0 api dependency reduction - marshalers (#5384)
Refactor Marshal logic on types, and move it into /lib/services to reduce dependencies in /api.
2021-02-01 10:26:50 -08:00
Brian Joerger 626ad243eb api dependency reduction - utils constants (#5363)
Moved constants and utils used in /api into /api/constants and /api/utils respectively.
2021-01-29 09:37:01 -08:00
Andrew Lytvynov 44cfbd4b6d Fix common misspellings detected by misspell linter 2020-05-11 16:44:27 +00:00
Andrew Lytvynov d1ea40d074 Enable linters: deadcode,goimports,govet,typecheck
And fix the relevant findings for these linters.

Also, set extra flags for `golangci-lint run` to make sure no findings
are suppressed.
2020-04-17 17:46:51 +00:00
Sasha Klizhentas 2646b1d32d Marshal YAML as list of documents, fixes #2479
This commit fixes an issue when tctl
output in YAML was not compatible with tctl create.

Before:

```
$ tctl get users

- User: value
- User: value
```

After:

```
$ tctl get users

User: value
---
User: value
```
2019-02-11 16:04:18 -08:00
Russell Jones ce1c7476b9 Updated dir backend to a flat keyspace. Added UpsertItems endpoint to
all backends to support bulk insertion. Added UpsertNodes endpoint,
which is used by the state cache to speed up GetNodes.
2018-07-13 20:12:34 +00:00
Sasha Klizhentas 0adebbcec6 continue work on roles 2016-12-08 18:43:37 -08:00