For feature parity with uc. Only _really_ usefull for ucind cluster rm,
but still useful, and not many lines of code.
Signed-off-by: Miek Gieben <miek@miek.nl>
* Allow for argument completion
This shows for a single command on how to complete service names in the
cluster: `uc inspect <TAB>` will complete using ListServices
See: #307
Signed-off-by: Miek Gieben <miek@miek.nl>
* All cluster interactions can be completed
Signed-off-by: Miek Gieben <miek@miek.nl>
* Machines -m flag completion
Signed-off-by: Miek Gieben <miek@miek.nl>
* Add completion for "ctx use"
Signed-off-by: Miek Gieben <miek@miek.nl>
* Complete from compose file too
Signed-off-by: Miek Gieben <miek@miek.nl>
* Allow for argument completion
This shows for a single command on how to complete service names in the
cluster: `uc inspect <TAB>` will complete using ListServices
See: #307
Signed-off-by: Miek Gieben <miek@miek.nl>
* All cluster interactions can be completed
Signed-off-by: Miek Gieben <miek@miek.nl>
* Machines -m flag completion
Signed-off-by: Miek Gieben <miek@miek.nl>
* Add completion for "ctx use"
Signed-off-by: Miek Gieben <miek@miek.nl>
* Complete from compose file too
Signed-off-by: Miek Gieben <miek@miek.nl>
* Move to better place
Signed-off-by: Miek Gieben <miek@miek.nl>
* Adjust imports
Signed-off-by: Miek Gieben <miek@miek.nl>
* prefix match for context too
Signed-off-by: Miek Gieben <miek@miek.nl>
---------
Signed-off-by: Miek Gieben <miek@miek.nl>
* ucind: implement cluster list
I keep forgetting my ucind clusters, that add the missing list command:
```
% ./ucind cluster list
NAME MACHINES
miek1 machine-1
```
Just the name would have been enough, but to actually make use of the
tui table a machines list is handy as well.
(There isn't much bubbletea in ucind, but I thought lets start now).
Signed-off-by: Miek Gieben <miek@miek.nl>
* Filter directly when listing
Filter on ucind managed while listing clusters
Signed-off-by: Miek Gieben <miek@miek.nl>
---------
Signed-off-by: Miek Gieben <miek@miek.nl>
* feat: add uc ctx show
This only shows the current context and nothing more. On error nothing
is printed (also no error). This is useful to include in your prompt.
See: #314
Signed-off-by: Miek Gieben <miek@miek.nl>
* docs
Signed-off-by: Miek Gieben <miek@miek.nl>
---------
Signed-off-by: Miek Gieben <miek@miek.nl>
* logging: client side
Create internal/logs and put abstracted way service and machine logging in there
This adds the bits to do machine logging of the services.
See #273 and discussion in #158
Signed-off-by: Miek Gieben <miek@miek.nl>
* go mod tidy
Signed-off-by: Miek Gieben <miek@miek.nl>
* fix typo
Signed-off-by: Miek Gieben <miek@miek.nl>
* Hook it up further
Signed-off-by: Miek Gieben <miek@miek.nl>
* Check unit validity server side
Signed-off-by: Miek Gieben <miek@miek.nl>
* Make cli-docs
Signed-off-by: Miek Gieben <miek@miek.nl>
* Add newline to logs
Signed-off-by: Miek Gieben <miek@miek.nl>
* docs
Signed-off-by: Miek Gieben <miek@miek.nl>
* Polish a bit
Signed-off-by: Miek Gieben <miek@miek.nl>
* comment fix
Signed-off-by: Miek Gieben <miek@miek.nl>
* There is no groupid
Signed-off-by: Miek Gieben <miek@miek.nl>
---------
Signed-off-by: Miek Gieben <miek@miek.nl>
* Add corrosion admin client function to get RTT to other machines in the cluster
* Add `uc machine rtt` showing all pair-wise RTT stats from corrosion
* Add long description to machine rtt command
* Include machine peer RTTs in InspectMachine instead of adding new gRPC API for it
* Add nil check on InspectMachine's Rtt field to protect from a potential edge case
* Generate docs for machine rtt command
* Handle m.Message being nil when a node is down or unavailble
* Update cli-docs
* Use tui Table instead of tabwriter
* Change reported RTT to the median rather than mean. Still calculate include stddev, as it might be a useful indication of network jitter.
* Show RTT to peers in `wg show` output
* Update cli docs
Use same logic as in uc to allow overriding the uncloud config location
via env var UNCLOUD_CONFIG. And remove the TODO.
Signed-off-by: Miek Gieben <miek@miek.nl>
* Check autom if we can connect via Unix socket
When there is no config, but a unix socket does exist, connect via the
unix socket. Prohibit saving the config if this is the case.
Fixes: #148
Use the new CutPrefix to shorten some code.
Signed-off-by: Miek Gieben <miek@miek.nl>
* remove error checking; it can not be hit
Signed-off-by: Miek Gieben <miek@miek.nl>
* Extra error text when logged in locally
Signed-off-by: Miek Gieben <miek@miek.nl>
---------
Signed-off-by: Miek Gieben <miek@miek.nl>
This adds 'doc --manual' that generates the manual pages in the current
directory.
This allows for packaging the manual pages in the same way as the
completion, e.g. https://github.com/miekg/unpkg/blob/main/deb/uncloud/debian/rules#L28
(For debian packages local manpages should be included)
Signed-off-by: Miek Gieben <miek@miek.nl>
This runs:
```
go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix ./...
```
over the codebase, as this is using go 1.26, it can also use the new
new() functionallity so AsPtr and boolPtr is are needed anymore.
Signed-off-by: Miek Gieben <miek@miek.nl>