Description: When docker build with contectDir buildconfig, the value defined in json file cannot be passed to buildconfig description and after import the buildconfig to a json file, the parameter displays like "dockerStrategy": {}, instead of "dockerBuildStrategy": {"contextDir": "./"}; If use "dockerStrategy": {} to reveal context folder, the item "Context Directory" in buildconfig description will disappear. Version-Release number of selected component (if applicable): openshift-master-0.2.2-0.git.83.6d09bd9.el7ose.x86_64 openshift-0.2.2-0.git.83.6d09bd9.el7ose.x86_64 openshift-sdn-master-0.4-1.el7.x86_64 openshift-sdn-0.4-1.el7.x86_64 How reproducible: always steps to Reproduce: 1. Create a project test $osc create -f project.json 2. Edit application-template-dockerbuild.json to input directory which contains additional directory to source URI: vim application-template-dockerbuild.json "parameters": { "source" : { "type" : "Git", "git" : { "uri": "git://github.com/openshift/ruby-hello-world.git" } }, "strategy": { "type": "Docker", "dockerBuildStrategy": { "contextDir": "./config" } }, 3.Submit the application template for processing and create the application using the processed template: $osc process -n test -f application-template-dockerbuild.json | osc apply -n test -f - 4. Describe the buildconfig 5. Export the buildconfig 6. Do not change anything and update buildconfig with this json file 7. Describe the buildconfig again Actual results: 4. [root@osev3-master sample-app]# osc describe buildconfigs ruby-sample-build -n wzheng2 Name: ruby-sample-build Annotations: <none> Created: 2015-02-09 01:14:51 -0500 EST Strategy: Docker Context Directory: <none> BaseImage: <none> Source Type: Git URL: git://github.com/wzheng1/ruby-hello-world.git Output to: origin-ruby-sample Output Spec: <none> Webhook Github: localhost/osapi/v1beta1/buildConfigHooks/ruby-sample-build/secret101/github Webhook Generic: localhost/osapi/v1beta1/buildConfigHooks/ruby-sample-build/secret101/generic Image Repository Trigger: ruby-20-centos - Tag: latest - Image: openshift/ruby-20-centos - LastTriggeredImageID: <none> 5. "dockerBuildStrategy" changed to "dockerStrategy": "parameters": { "source": { "type": "Git", "git": { "uri": "git://github.com/wzheng1/ruby-hello-world.git" } }, "strategy": { "type": "Docker", "dockerStrategy": { "contextDir": "./config" } }, 7. "Context Directory" is gone: [root@osev3-master sample-app]# osc describe buildconfigs ruby-sample-build -n wzheng2 Name: ruby-sample-build Annotations: <none> Created: 2015-02-09 01:14:51 -0500 EST Strategy: Docker BaseImage: <none> Source Type: Git URL: git://github.com/wzheng1/ruby-hello-world.git Output to: origin-ruby-sample Output Spec: <none> Webhook Github: localhost/osapi/v1beta1/buildConfigHooks/ruby-sample-build/secret101/github Webhook Generic: localhost/osapi/v1beta1/buildConfigHooks/ruby-sample-build/secret101/generic Image Repository Trigger: ruby-20-centos - Tag: latest - Image: openshift/ruby-20-centos - LastTriggeredImageID: <none> Expected results: The parameter should be passed and works during docker build. Additional info:
Since Nov 5th, 2014 parameter describing DockerBuildStrategy [1] is called 'dockerStrategy', I'm guessing you should update your test case for that to be relevant with current state of the system. [1] https://github.com/openshift/origin/blob/b55a679e23e7fec2ab61d41428ca2ff0e064590a/pkg/build/api/v1beta1/types.go
Reopen on fedora_791: Yes, the 'dockerBuildStrategy' has changed to 'dockerStrategy'. But there is no item "Context Directory:" in the description of buildconfig for "dockerStrategy"; it has for 'dockerBuildStrategy'. Detailed display is in above Expected result part.
Yes there is contextDir in dockerStrategy and it works OK, look here [1]. The json might look like this: "strategy": { "type": "Docker", "dockerStrategy": { "contextDir": "./config", }, }, [1] https://github.com/openshift/origin/blob/b55a679e23e7fec2ab61d41428ca2ff0e064590a/pkg/build/api/v1beta1/types.go#L146
Yes, the contextDir works well. The bug I want to make clear is in buildconfig description which is invoked by "osc describe buildconfig ruby-sample-build": the only difference between the description of old "dockerBuildStrategy" and new "dockerStrategy" is there is no "Context Directory: " between line " Strategy: " and "BaseImage: " for new "dockerStrategy" . So the bug here is about "Context Directory:"is MISSING in buildconfig description for "dockerStrategy" (I really wish I can make it highlight in the output in the Actual result of my original description). I have also update the bug tiltle to make it clear, sorry for confusing you.
That is already handled in current version properly, see https://github.com/openshift/origin/blob/master/pkg/cmd/cli/describe/describer.go#L99, so I'm closing this bug as currentrelease.