Repository navigation
Make logs work for builds - #4997
Conversation
|
I like it 👍 esp that I can use a bc name and don't need to get the build name. Though it would make sense that we allow other objects like dc/deployments |
Deployment logs haven't landed. I don't want to steal @Kargakis's thunder. :) |
There was a problem hiding this comment.
This has to be abstracted out into a method on Factory for this to be viable.
There was a problem hiding this comment.
This has to be abstracted out into a method on Factory for this to be viable.
By "this", you mean the idea of handling logs for different kinds of resources? If we could agree on all flags, I definitely agree. However, things like --nowait seem useful and also unlikely to move upstream. I could also envision flags "this many builds/deployments before current" and "show me logs for a pod in the RC of a DC's current deployment". I want my oc logs command to do all those things.
There was a problem hiding this comment.
I'm fine with it for now.
On Oct 7, 2015, at 3:03 PM, David Eads [email protected] wrote:
In pkg/cmd/cli/cmd/logs.go
#4997 (comment):
- resourceType := "pod"
- resourceName := o.ResourceString
- tokens := strings.SplitN(o.ResourceString, "/", 2)
- if len(tokens) == 2 {
resourceType = tokens[0]resourceName = tokens[1]- }
- resourceType = strings.ToLower(resourceType)
+- // if we're requesting a pod, delegate directly to kubectl logs
- if (tokens[0] == "pods") || (tokens[0] == "pod") || len(o.ContainerName) > 0 {
kLogsOptions.PodName = resourceNamereturn kLogsOptions.RunLog()- }
+- switch resourceType {
This has to be abstracted out into a method on Factory for this to be
viable.
By "this", you mean the idea of handling logs for different kinds of
resources? If we could agree on all flags, I definitely agree. However,
things like --nowait seem useful and also unlikely to move upstream. I
could also envision flags "this many builds/deployments before current" and
"show me logs for a pod in the RC of a DC's current deployment". I want my oc
logs command to do all those things.
—
Reply to this email directly or view it on GitHub
https://github.com/openshift/origin/pull/4997/files#r41431680.
There was a problem hiding this comment.
This has to be abstracted out into a method on Factory for this to be viable.
Let's open an issue about this
d42741e to
a4bca79
Compare
|
Yay! Time to deprecate oc build-logs, finally. |
|
If we are going to deprecate build-logs, I would prefer exposing deployment logs only after this PR lands (and not via deploy --logs). We wouldn't be able to view at older deployments without introducing a new flag here but we could also avoid that once we start using upstream deployments. @smarterclayton @ironcladlou thoughts? |
Clearly it should have annoyed me while I was at work sooner. :) |
|
Related issue: #2659 |
|
Definitely agree that this should be the foundation for deployment logs. |
a4bca79 to
8b4f77e
Compare
|
[test] |
|
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/5592/) |
8b4f77e to
567b61a
Compare
|
To be honest I am worried about carrying our own version of the command. We already do something similar with Separate issue after this lands is ok. |
Something similar to |
|
Ready for review. The |
Check how we currently generate parameters for expose and run https://github.com/kubernetes/kubernetes/blob/036fe1684973f323f75a55cb3ce01fbf23ba1d1b/pkg/kubectl/generate.go#L67 Also how we added --hostname to expose without actually touching any code upstream: https://github.com/openshift/origin/pull/2744/files |
Yeah, that doesn't solve the problem. If they choose a flag that conflicts with yours, you're still screwed. |
How is that? If they choose the same flag, the result is still the same since its up to the generator to give a meaning to the flag. For example, if they add --hostname to expose, our --hostname would still be the same for routes (plus we would drop the flag). Regarding the URLValuesGenerator, --nowait would translate to ?nowait=true in both cases |
We would still have to abstract in the factory though |
Who's to say that didn't choose to make that a flag a different type? I guess in the |
|
The problem I had while working on abstracting the logging to the factory (https://github.com/openshift/origin/pull/3672/files) was that I couldn't carry our own url values since I was passing a PodLogOptions which is limited. I think that a generator that would break everything down to a map would be sufficient and solve this but I may be wrong. I will play around with it tomorrow. |
|
@Kargakis are you requesting that we hold this pull on it? |
There was a problem hiding this comment.
Include examples of the other resource types
|
I'm ok with this being done in stages, we are going to hit this with jobs On Oct 8, 2015, at 2:29 PM, David Eads [email protected] wrote: @Kargakis https://github.com/kargakis are you requesting that we hold — |
|
@deads2k check https://github.com/kargakis/origin/tree/url-values-generator I am fine with this PR going in now but I think in the long run we would better continue use upstream logs |
|
Anyone have comments other than the example? |
There was a problem hiding this comment.
-c CONTAINER
I think we want to emphasize the fact that we take more resources, so I've made it match Use.
567b61a to
466f659
Compare
466f659 to
f1c6fbe
Compare
|
comments addressed. |
|
Evaluated for origin test up to f1c6fbe |
|
LGTM |
|
[merge] |
|
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_origin/3545/) (Image: devenv-fedora_2452) |
|
Evaluated for origin merge up to f1c6fbe |
This adds support to
oc logsto handle buildconfigs and builds. For a buildconfig, it locates the most recent build for the buildconfig and displays its logs. I could see an argument for including--nowaitonoc logs, but for now I've hardcoded the default.Fixes #2659
@bparees @csrwng @smarterclayton @Kargakis Complaints in principle?