api_service: Implement GetLogs RPC request #2662
Conversation
164701a
to
4c8103a
Compare
@@ -1,6 +1,8 @@ | |||
# Configures rkt tests at Travis CI (https://travis-ci.org). | |||
|
|||
language: go | |||
sudo: required |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this necessary given we were already sudoing things?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just following https://docs.travis-ci.com/user/trusty-ci-environment/
4c8103a
to
1981c9f
Compare
Updated. |
PTAL. |
@@ -236,23 +236,28 @@ | |||
}, | |||
{ | |||
"ImportPath": "github.com/coreos/go-systemd/activation", | |||
"Comment": "v5", | |||
"Rev": "7b2428fec40033549c68f54e26e89e7ca9a9ce31" | |||
"Comment": "v6-4-g0f21494", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need a tagged version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+:100:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lucab I see you tagged the last version of go-systemd. Could you tag yet another version for this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1981c9f
to
bc21b6b
Compare
Updated |
bc21b6b
to
051bd6b
Compare
Will this work on systems without systemd/journald? |
Nope |
ack. |
} | ||
jconf.Matches = []sdjournal.Match{ | ||
{ | ||
Field: sdjournal.SD_JOURNAL_FIELD_SYSTEMD_UNIT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Susceptible to the race mentioned in #2630? Should this use the SYSLOG_IDENTIFIER
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, forgot to update that after #2630
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bd65c46
to
f0cea2e
Compare
Updated. Pending on a go-systemd release. |
I assigned on to @lucab On Thu, May 26, 2016 at 3:03 PM, Iago López Galeiras <
|
Tagged go-systemd v8: https://github.com/coreos/go-systemd/releases/tag/v8 |
f0cea2e
to
7ada855
Compare
Thanks! |
} | ||
|
||
s.mu.Lock() | ||
jr, ok := s.journalReaders[request.PodId] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since jconf
is where all request configuration ends up, but isn't used here, would recycling a reader lose that configuration?
e.g. I call once with tail=10
and a reader is created and cached with that configuration, and then I call again with tail=1000
and still only get 10 lines because the cached journalReader has that config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. I think we should go back to one JournalReader per call... @jonboulle
Can we have tests? :) |
Definitely |
I'll revert kinvolk@e1fc014 |
7ada855
to
06781b1
Compare
Updated. |
}) | ||
if err != nil { | ||
fmt.Println(err) | ||
os.Exit(2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dunno, this stupid error numbering. I guess it should be 3, and then 4, and then 5. I can just get rid of those like we did with init.go some time ago
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, sequential numbering never works, settle on 1 unless you wanted to
try use something like http://linux.die.net/include/sysexits.h
On Fri, May 27, 2016 at 2:21 PM, Iago López Galeiras <
notifications@github.com> wrote:
In api/v1alpha/client_example.go
#2662 (comment):@@ -51,6 +51,24 @@ func main() {
for _, p := range podResp.Pods { fmt.Printf("Pod %q is running\n", p.Id)
logsResp, err := c.GetLogs(context.Background(), &v1alpha.GetLogsRequest{
PodId: p.Id,
})
if err != nil {
fmt.Println(err)
os.Exit(2)
Dunno, this stupid error numbering. I guess it should be 3, and then 4,
and then 5. I can just get rid of those like we did with init.go some time
ago—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/coreos/rkt/pull/2662/files/c28aa39ba2c92941f58487762ed66bf9e93d0d01..cc72b0fb026b3fb54a9a9bb24e29f5ed86f8df50#r64896509,
or mute the thread
https://github.com/notifications/unsubscribe/ACewN0s-tIsx_Ge3uE7wnpSOHppyL1lMks5qFuHKgaJpZM4IiF05
.
Adds new dep on coreos/pkg
To avoid the race mentioned in rkt#2630.
Sequential numbering of errors is evil.
06781b1
to
d0a749a
Compare
Updated |
LGTM if green. |
Allows being able to get the logs of a pod with the API service without forking off journalctl.
Fixes #1970
Depends on coreos/go-systemd#160