* 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>
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>
* Add server side of journal logs
This add the server side and grpc methods to get a journal logs from a
machine. It repurposes ServiceLogEntry for these logs to keep the
changes somewhat to a minimum. And it lets us re-use the merging of the
various logs. In the protobufs ContainerLog has been renamed to just Log
and LogEntry, as these are now also used for journal logs.
It does api.LogOptions in more places to reduce the various logOpts that
were used.
It does not yet plumb it through to the uc client, that needs a follow
up pr. Following logs is also not yet implemented.
Signed-off-by: Miek Gieben <miek@miek.nl>
* Fix test too
Signed-off-by: Miek Gieben <miek@miek.nl>
* remove entire comment
Signed-off-by: Miek Gieben <miek@miek.nl>
* Implement the follow option, untested mind you
Signed-off-by: Miek Gieben <miek@miek.nl>
* update debug line
Signed-off-by: Miek Gieben <miek@miek.nl>
* internal/jounal: First batch of PR comments
Signed-off-by: Miek Gieben <miek@miek.nl>
* internal/journal: code review comments
Signed-off-by: Miek Gieben <miek@miek.nl>
* Manually apply suggestion
Signed-off-by: Miek Gieben <miek@miek.nl>
* apply comment manually
Signed-off-by: Miek Gieben <miek@miek.nl>
* internal/journal: add unit test
Signed-off-by: Miek Gieben <miek@miek.nl>
* Use testify
Signed-off-by: Miek Gieben <miek@miek.nl>
* -amFix scanner.Err checking
Signed-off-by: Miek Gieben <miek@miek.nl>
* Implement code review comments
Signed-off-by: Miek Gieben <miek@miek.nl>
---------
Signed-off-by: Miek Gieben <miek@miek.nl>
* feat: error on unsupported compose features
This implements a check for the unimplemented features of the uncloud
support matrix and points to the matrix in the error.
Fixes: #237
This redos #277, as I messed up my branch, (basically rebase gone
wrong).
Signed-off-by: Miek Gieben <miek@miek.nl>
* Fix tests by capturing stderr
The error should be nil, but we _do_ want to know if the user saw an
warning. Redirect stderr to capture this as the error is emited by
printing to stderr.
Signed-off-by: Miek Gieben <miek@miek.nl>
---------
Signed-off-by: Miek Gieben <miek@miek.nl>
On arm64 the x86 version of corrosion was downloaded. This downloads
the correct version. Also added comments to HACKING.md on how to clean
up a broken cluster as I have done it twice now and forgot how to do it
both times.
Fixes: #284
~~~ shell
% ./ucind cluster create miektest
Cluster "miektest" initialised with machine "machine-1"
Waiting for cluster to be ready... done.
Cluster 'miektest' added to Uncloud config as the current context.
Cluster 'miektest' created.
~~~
`uc machine ls` also works.
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>