-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Stream logs from deployed containers #30
Conversation
@dlorenc this should be ready for a look too |
pkg/skaffold/kubernetes/log.go
Outdated
return errors.Wrap(err, "writing to out") | ||
} | ||
} | ||
msg := fmt.Sprintf("%s Stream finished", header) |
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.
fmt.fprintf
return errors.Wrap(err, "getting pods") | ||
} | ||
logrus.Infof("Looking for logs to stream for %s", image) | ||
for _, p := range pods.Items { |
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 put these into the Pods("") query instead of doing the selection here?
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 don't think that field selectors support anything nested like container image fields. I couldn't find any examples of this
this should be ready for another look |
Interfacer throws a warning on passing a PodInterface as a corev1.CoreV1Interface but the client-go code restricts us from doing so.
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.
One last comment about a cancel channel.
if bRes != nil { | ||
for _, b := range bRes.Builds { | ||
tag := b.Tag | ||
go kubernetes.StreamLogsRetry(r.out, r.kubeclient.CoreV1(), tag, 5) |
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.
Do we need to pass in a cancel channel?
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.
It will exit when the container exists on the cluster, so you'll receive messages up until then, which is kind of a feature 👍
Depends on #28
Fixes #26