-
Notifications
You must be signed in to change notification settings - Fork 881
api: GetLogs: improve client example with 'Follow' #2747
Conversation
Previously, client_example was only able to call GetLogs without the 'Follow' option. This patch updates client_example.go to show how to test calls to GetLogs both with and without the 'Follow' option.
I think that getLogsWithoutFollow and getLogsWithFollow should be one function with additional param stream = true | false. And if its not stream we should break for loop after first iteration. This doesn't work with kvm flavor. I get empty logs. With coreos flavor:
In api-service:
|
@pskrzyns I got the same crash with the same stack (with |
@pskrzyns I think my changes in go-systemd were wrong, as explained by @lucab there. So I was not suggested that you that, I was wondering if the crash were caused by them. But since you are not testing my go-systemd changes, the crash is not related. For some unknown reasons, that crash with that stack does not happen for me anymore. I don't know why. I thought it was because I dropped my patch on go-systemd. |
LGTM on this PR, this PR doesn't seem to related with the panic. |
For some reason, journal integration doesn't work with the kvm flavor. Running |
AFAIR kvm flavor does not register correctly in systemd-machined but still these logs could be readed with @pskrzyns could you elaborate a bit about this? |
If we register with |
It seems persistent journaling is not enabled in the kvm stage1. |
I figured out why the journal is not persistent. I started a kvm pod, changed root to stage1, copied a static strace program there and ran
So apparently, the journal doesn't go to |
After mounting a |
Ough, very detailed info. |
As @xelatex mentioned, this LKVM patch solves the problem. But we apply this patch for LKVM. After removing it, I can see logs. |
See #2795 |
IMO |
With this PR, the api client_example gets a new flag
-follow
to use the 'Follow' feature of GetLogs.To test this, start with running a container:
In another terminal, start rkt's API service:
In another terminal, start client_example with different options:
See also #2740
/cc @yifan-gu @euank @pskrzyns