-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update kpod logs to use the new container state and runtime #62
Conversation
the --tail flag is still broken #16, but the tests pass (not sure why). Will get back to that later. |
LGTM, assuming happy tests. |
cmd/kpod/logs.go
Outdated
@@ -4,8 +4,9 @@ import ( | |||
"fmt" | |||
"time" | |||
|
|||
"github.com/projectatomic/libpod/libpod" | |||
|
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.
Remove the extra spaces around the github lines.
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.
fixed
libpod/runtime_ctr.go
Outdated
"time" | ||
|
||
"github.com/hpcloud/tail" | ||
|
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.
Remove line
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.
fixed
libpod/runtime_ctr.go
Outdated
return ErrRuntimeStopped | ||
} | ||
|
||
defer close(logChan) |
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.
Should this be before the check above? Does the user expect the channel to be closed when GetLogs returns?
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.
uh, not sure I just modified the code that was already written, which was like this.
libpod/runtime_ctr.go
Outdated
return r.lookUpContainer(idOrName) | ||
} | ||
|
||
func (r *Runtime) lookUpContainer(idOrName string) (*Container, error) { |
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 do we need this extra function?
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 worried about the lock hanging again, but not needed anymore. fixed
libpod/runtime_ctr.go
Outdated
|
||
// GetLogs returns the logs of a container from the log file | ||
// log file is created when the container is started/ran | ||
func (r *Runtime) GetLogs(container string, logChan chan string, opts LogOptions) error { |
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.
Can we move this out to cmd/kpod? I don't think we need anything in the runtime for this aside from the container, which you can just get with LookupContainer
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.
fixed.
I don't like having the log parsing inside the runtime. I think we should move it either into cmd/kpod or into container.go. Otherwise looks fine. |
0a5c238
to
0515ff9
Compare
Signed-off-by: Urvashi Mohnani <[email protected]>
LGTM. @rhatdan PTAL |
📌 Commit 2a51d53 has been approved by |
⚡ Test exempted: pull fully rebased and already tested. |
bridge: various fixes
Signed-off-by: Urvashi Mohnani [email protected]