Bug 1250292 - [origin_devexp_624]`oc build-logs` cannot print recent builds with no args
Summary: [origin_devexp_624]`oc build-logs` cannot print recent builds with no args
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: oc
Version: 3.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Rodolfo Carvalho
QA Contact: wewang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-05 03:29 UTC by wewang
Modified: 2015-09-08 20:13 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-09-08 20:13:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description wewang 2015-08-05 03:29:09 UTC
Description of problem:
`oc build-logs` cannot  print a list of recent builds with no args after starting a new build.

Version-Release number of selected component (if applicable):
devenv-fedora_2103
oc v1.0.4-59-g786896f
kubernetes v1.0.0

How reproducible:
always

Steps to Reproduce:
1. User log into openshift
2. Create a new  project
# oc new-project testproject
3. Submit the template for processing and then request creation of the processed template:
$oc new-app application-template-dockerbuild.json
4. Check the build
# oc get builds
NAME                  TYPE      STATUS    POD
ruby-sample-build-1   Docker    Running   ruby-sample-build-1-build
5. # oc build-logs

Actual results:
5. # oc build-logs
error: A build name is required
see 'oc build-logs -h' for help.

Expected results:
5. # oc build-logs
error: A build name is required. Most recent builds: 
* ruby-sample-build-1 Running 2 seconds ago

Additional info:

Comment 1 Rodolfo Carvalho 2015-08-05 08:40:20 UTC
(In reply to wewang from comment #0)
> Description of problem:
> `oc build-logs` cannot  print a list of recent builds with no args after
> starting a new build.
> 
> Version-Release number of selected component (if applicable):
> devenv-fedora_2103
> oc v1.0.4-59-g786896f
> kubernetes v1.0.0
> 
> How reproducible:
> always
> 
> Steps to Reproduce:
> 1. User log into openshift
> 2. Create a new  project
> # oc new-project testproject
> 3. Submit the template for processing and then request creation of the
> processed template:
> $oc new-app application-template-dockerbuild.json
> 4. Check the build
> # oc get builds
> NAME                  TYPE      STATUS    POD
> ruby-sample-build-1   Docker    Running   ruby-sample-build-1-build
> 5. # oc build-logs
> 
> Actual results:
> 5. # oc build-logs
> error: A build name is required
> see 'oc build-logs -h' for help.
> 
> Expected results:
> 5. # oc build-logs
> error: A build name is required. Most recent builds: 
> * ruby-sample-build-1 Running 2 seconds ago
> 
> Additional info:


Thanks for reporting this. We'll need to update the test case.

The list of builds is only shown if the server returns the list of builds in less than 800ms.

This is intended behavior as per the original GitHub issue (https://github.com/openshift/origin/issues/3359).


Could you time the execution of `oc build-logs`?


You should see something like this:


$ time oc build-logs
error: There are no builds in the current project
see 'oc build-logs -h' for help.

real    0m0.716s
user    0m0.518s
sys     0m0.091s

Comment 2 wewang 2015-08-05 09:02:22 UTC
I launch an instance with the  origin image named devenv-fedora_2103 which was built nightly  in EC2 and excute time oc build-logs as follow:

[fedora@ip-10-167-213-48 sample-app]$ time oc build-logs
error: A build name is required
see 'oc build-logs -h' for help.

real	0m0.828s
user	0m0.014s
sys	0m0.004s

Comment 3 Rodolfo Carvalho 2015-08-10 10:26:14 UTC
`oc build-logs` was changed to always print a simpler message but include how to list builds with `oc get builds`.

Here's an example terminal session:


$ oc build-logs
error: A build name is required - you can run `oc get builds` to list builds
see 'oc build-logs -h' for help.
$ oc build-logs -n demo
error: A build name is required - you can run `oc get builds -n demo` to list builds
see 'oc build-logs -h' for help.
$ oc build-logs -n default
error: A build name is required - you can run `oc get builds -n default` to list builds
see 'oc build-logs -h' for help.


No more API calls, no more timeouts, no more list of builds in the error message.

wewang please confirm it works for you.

Comment 4 wewang 2015-08-13 05:54:40 UTC
verified pass in oc v1.0.4-218-g1d44585

$ oc build-logs          
error: A build name is required - you can run `oc get builds` to list builds
see 'oc build-logs -h' for help.
$ oc build-logs -n default
error: A build name is required - you can run `oc get builds -n default` to list builds
see 'oc build-logs -h' for help.
$ oc build-logs -n demo
error: A build name is required - you can run `oc get builds -n default` to list builds
see 'oc build-logs -h' for help.


Note You need to log in before you can comment on or make changes to this bug.