Description of problem: It's failed to get build dependency trees for all tags in the specified image repository. Version-Release number of selected component (if applicable): devenv_fedora_1136 openshift v0.4.1-313-g1f5063f kubernetes v0.12.0-992-gc5f7351 How reproducible: always Steps to Reproduce: 1. Setup the OpenShift V3 environment according to: https://github.com/openshift/origin/tree/master/examples/sample-app 2. Create a namespace named "chun1" $ openshift ex new-project chun1 --display-name="OpenShift 3 Sample" --description="This is an example project to demonstrate OpenShift v3" --admin=anypassword:test-admin 3. Submit the application template for processing and then request creation of the processed template $ osc process -n chun1 -f application-template-stibuild.json | osc create -n chun1 -f - 4. Get build dependency trees in the specific namespace from step 2 $ openshift ex build-chain -n chun1 5. Get build dependency tree for all tags of a specific image repository 1) $ openshift ex build-chain ruby-20-centos7 --all-tags 2) $ openshift ex build-chain ruby-20-centos7 -n chun1 --all-tags Actual results: at step 4: { "fullname": "chun1/ruby-20-centos7", "tags": [ "latest" ], "edges": [ { "fullname": "chun1/ruby-sample-build", "to": "chun1/origin-ruby-sample" } ], "children": [ { "fullname": "chun1/origin-ruby-sample", "tags": [ "" ] } ] } at step 5.1: F0326 10:16:27.814706 16427 buildchain.go:140] imageRepository "ruby-20-centos7" not found at step 5.2: return nothing Expected results: Should get build dependency trees for all tags in the specified image repository. Additional info:
Commit pushed to master at https://github.com/openshift/origin https://github.com/openshift/origin/commit/f4d8bf0237197c1d559b892aa1b7263584607870 Bug 1206109 - Default empty tag slice to 'latest'
the issue is also reproduced for command "openshift ex build-chain [image-repository] --all-tags", think this command should show the build dependency trees for all tags in the specified image repository in *all* namespaces, not just in *current* namespace, could you please help to confirm if i am right? Thanks!
--all-tags is only for the current namespace.
Thanks for confirming, but it still does not work well, it only detects the *latest* tag instead of all tags, like below results: # openshift ex build-chain ruby-20-centos7-2 --all-tags -n test I0330 03:30:27.239605 16327 buildchain.go:178] test/ruby-20-centos7-2:latest has no dependencies # openshift ex build-chain ruby-20-centos7-2:stiv1 --all-tags -n test { "fullname": "test/ruby-20-centos7-2", "tags": [ "stiv1" ], "edges": [ { "fullname": "test/ruby-sample-build2", "to": "test/origin-ruby-sample2" } ], "children": [ { "fullname": "test/origin-ruby-sample2", "tags": [ "" ] } ] }
Commit pushed to master at https://github.com/openshift/origin https://github.com/openshift/origin/commit/df9ffa136f9fdbc88f33684786914c22dfda5946 Bug 1206109 - build-chain: Set tags correctly
Checked the issue against devenv_fedora_1181, it's still reproduced as the same results as Comment #4. For testing, I used this application template json file [1], but edit it like below: <-----------------sinp-------------------> "imageChange": { "from": { "name": "ruby-20-centos7" }, "image": "openshift/ruby-20-centos7", "tag": "stiv1" ### set it with my defined tag instead of the "latest" tag }, <-----------------sinp-------------------> [1] https://github.com/openshift/origin/blob/master/examples/sample-app/application-template-stibuild.json Thanks!
The test results w/o modifying the template are as below: [root@ip-10-157-110-97 sample-app]# openshift ex build-chain ruby-20-centos7 --all-tags -n test { "fullname": "test/ruby-20-centos7", "tags": [ "latest" ], "edges": [ { "fullname": "test/ruby-sample-build", "to": "test/origin-ruby-sample" } ], "children": [ { "fullname": "test/origin-ruby-sample", "tags": [ "" ] } ] } I0403 02:54:13.801478 3849 buildchain.go:204] test/ruby-20-centos7:v0.4 has no dependencies [root@ip-10-157-110-97 sample-app]# openshift ex build-chain ruby-20-centos7:latest --all-tags -n test I0403 02:54:23.574428 3859 buildchain.go:204] test/ruby-20-centos7:v0.4 has no dependencies { "fullname": "test/ruby-20-centos7", "tags": [ "latest" ], "edges": [ { "fullname": "test/ruby-sample-build", "to": "test/origin-ruby-sample" } ], "children": [ { "fullname": "test/origin-ruby-sample", "tags": [ "" ] } ] }
Great, these results on #7 are ok. Now, regarding your template change, it's invalid because we pull that image from DockerHub and there is no "stiv1" over there: https://registry.hub.docker.com/u/openshift/ruby-20-centos7/tags/manage/ So, when we run openshift ex build-chain ruby-20-centos7:stiv1 we should get nothing back. I will shortly submit a patch for this.
Commit pushed to master at https://github.com/openshift/origin https://github.com/openshift/origin/commit/89413d9d0b589954632ed099114596b7726cd95f Bug 1206109: Handle specified tags that don't exist in the specified image repository
Patch is live. Expected behavior with your edited template: $ openshift ex build-chain ruby-20-centos7:stiv1 --all-tags I0401 11:06:33.4372543202 buildchain.go:179] chun1/ruby-20-centos7:latest has no dependencies I0401 11:06:33.4372543202 buildchain.go:179] chun1/ruby-20-centos7:v0.4 has no dependencies since the buildconfig will not be in the chain because it is triggered by the "stiv1" tag which is not present in the imagerepository.
it's fixed, verified on devenv_fedora_1226, please refer to the below results: [root@ip-10-169-178-13 chunchen]# osc get imagerepository -n test NAME DOCKER REPO TAGS origin-ruby-sample 172.30.17.144:5000/test/origin-ruby-sample ruby-20-centos7 openshift/ruby-20-centos7 latest,v0.4 [root@ip-10-169-178-13 chunchen]# openshift ex build-chain ruby-20-centos7:stiv1 --all-tags -n test I0408 02:50:46.279967 16584 buildchain.go:211] test/ruby-20-centos7:v0.4 has no dependencies I0408 02:50:46.280034 16584 buildchain.go:211] test/ruby-20-centos7:latest has no dependencies [root@ip-10-169-178-13 chunchen]# openshift ex build-chain ruby-20-centos7 --all-tags -n test I0408 02:50:33.340398 16517 buildchain.go:211] test/ruby-20-centos7:latest has no dependencies I0408 02:50:33.340560 16517 buildchain.go:211] test/ruby-20-centos7:v0.4 has no dependencies