Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

umohnani8
Copy link
Member

Signed-off-by: Urvashi Mohnani [email protected]

@umohnani8
Copy link
Member Author

@rhatdan @mheon PTAL

@umohnani8
Copy link
Member Author

the --tail flag is still broken #16, but the tests pass (not sure why). Will get back to that later.

@TomSweeneyRedHat
Copy link
Member

LGTM, assuming happy tests.

cmd/kpod/logs.go Outdated
@@ -4,8 +4,9 @@ import (
"fmt"
"time"

"github.com/projectatomic/libpod/libpod"

Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

"time"

"github.com/hpcloud/tail"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove line

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

return ErrRuntimeStopped
}

defer close(logChan)
Copy link
Member

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?

Copy link
Member Author

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.

return r.lookUpContainer(idOrName)
}

func (r *Runtime) lookUpContainer(idOrName string) (*Container, error) {
Copy link
Member

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?

Copy link
Member Author

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


// 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 {
Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

@mheon
Copy link
Member

mheon commented Nov 22, 2017

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.

@umohnani8 umohnani8 force-pushed the kpod_logs branch 2 times, most recently from 0a5c238 to 0515ff9 Compare November 22, 2017 19:11
@mheon
Copy link
Member

mheon commented Nov 22, 2017

LGTM. @rhatdan PTAL

@rhatdan
Copy link
Member

rhatdan commented Nov 22, 2017

@rh-atomic-bot r+

@rh-atomic-bot
Copy link
Collaborator

📌 Commit 2a51d53 has been approved by rhatdan

@rh-atomic-bot
Copy link
Collaborator

⚡ Test exempted: pull fully rebased and already tested.

@umohnani8 umohnani8 deleted the kpod_logs branch March 16, 2018 14:41
baude pushed a commit to baude/podman that referenced this pull request Aug 31, 2019
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 28, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants