Bug 1250292 - [origin_devexp_624]`oc build-logs` cannot print recent builds with no args
[origin_devexp_624]`oc build-logs` cannot print recent builds with no args
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
3.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Rodolfo Carvalho
wewang
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-04 23:29 EDT by wewang
Modified: 2015-09-08 16:13 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-09-08 16:13:59 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description wewang 2015-08-04 23:29:09 EDT
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 04:40:20 EDT
(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 05:02:22 EDT
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 06:26:14 EDT
`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 01:54:40 EDT
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.