-
Notifications
You must be signed in to change notification settings - Fork 244
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
Adds --follow command to odo log #496
Conversation
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.
If we are following logs, wouldn't it make more sense to just show new lines instead of showing everything from the start?
If I want to use odo log -f
I'm more interested in the future log lines than in what was there before. For that, I can run just odo log
.
cmd/log.go
Outdated
checkError(err, "Unable to retrieve logs, does your component exist?") | ||
}, | ||
} | ||
|
||
func init() { | ||
rootCmd.AddCommand(logCmd) | ||
|
||
logCmd.Flags().BoolVarP(&logWatch, "watch", "w", false, "Stream logs") |
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 use --follow
/ -f
?
I think that -f
is more standard for this kind of things. kubect logs -f
, tail -f
...
@kadel I'll make the changes! |
df786b4
to
59dc27a
Compare
d7f7324
to
14b2bf9
Compare
pkg/occlient/occlient.go
Outdated
// TODO: https://github.com/kubernetes/kubernetes/pull/60696 | ||
// Unable to set to 0, until we update our vendoring | ||
// set to 1 for now. | ||
tailLines := int64(1) |
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.
Need your insight on this @kadel
I'm blocked on issue kubernetes/kubernetes#60696
The commit didn't make it into the 1.10.0
Kubernetes release freeze. It will however be in the 1.11.0
release.
At the moment, the client-go
vendoring for OpenShift is at 1.10.2
https://github.com/openshift/client-go/blob/master/glide.yaml#L14
So we literally just have to wait until 1.11.0
of Kubernetes is released and go from there.
The current work-around is to set it to 1
, where it will only output 1 line from the previous log, until 1.11.0
is released.
Need your insight on this @kadel // If the log is being followed, set it to follow / don't wait
if followLog {
// TODO: https://github.com/kubernetes/kubernetes/pull/60696
// Unable to set to 0, until openshift/client-go updates their Kubernetes vendoring to 1.11.0
// Set to 1 for now.
tailLines := int64(1)
deploymentLogOptions = appsv1.DeploymentLogOptions{Follow: true, NoWait: false, Previous: false, TailLines: &tailLines}
} I'm blocked on issue kubernetes/kubernetes#60696 The commit didn't make it into the 1.10.0 Kubernetes release freeze. It will however be in the 1.11.0 release. At the moment, the client-go vendoring for OpenShift is at 1.10.2 https://github.com/openshift/client-go/blob/master/glide.yaml#L14 So we literally just have to wait until 1.11.0 of Kubernetes is released and go from there. The current work-around is to set it to 1, where it will only output 1 line from the previous log, until 1.11.0 is released. IMO, we should just add the TODO and leave an issue open until it's fixed. |
Setting it to It the future it might be good to have this as a parameter. But the current implementation is good for now. 👍 |
@kadel Awesome 👍 Code / review look good to you? |
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.
LGTM
This adds the --follow or -f command to `odo log` in order to stream logs as they are being built for DeploymentConfig.
This adds the --follow or -f command to
odo log
in order to stream logsas they are being built for DeploymentConfig.