Fedora Account System
Red Hat Associate
Red Hat Customer
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:
(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
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
`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.
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.