{"action":"created","issue":{"url":"https://api.github.com/repos/openshift/origin/issues/16154","repository_url":"https://api.github.com/repos/openshift/origin","labels_url":"https://api.github.com/repos/openshift/origin/issues/16154/labels{/name}","comments_url":"https://api.github.com/repos/openshift/origin/issues/16154/comments","events_url":"https://api.github.com/repos/openshift/origin/issues/16154/events","html_url":"https://github.com/openshift/origin/pull/16154","id":255384775,"number":16154,"title":"[WIP] parameterize a list of objects into a template ","user":{"login":"csrwng","id":5834976,"avatar_url":"https://avatars1.githubusercontent.com/u/5834976?v=4","gravatar_id":"","url":"https://api.github.com/users/csrwng","html_url":"https://github.com/csrwng","followers_url":"https://api.github.com/users/csrwng/followers","following_url":"https://api.github.com/users/csrwng/following{/other_user}","gists_url":"https://api.github.com/users/csrwng/gists{/gist_id}","starred_url":"https://api.github.com/users/csrwng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csrwng/subscriptions","organizations_url":"https://api.github.com/users/csrwng/orgs","repos_url":"https://api.github.com/users/csrwng/repos","events_url":"https://api.github.com/users/csrwng/events{/privacy}","received_events_url":"https://api.github.com/users/csrwng/received_events","type":"User","site_admin":false},"labels":[{"id":686389978,"url":"https://api.github.com/repos/openshift/origin/labels/do-not-merge/work-in-progress","name":"do-not-merge/work-in-progress","color":"b60205","default":false},{"id":364523381,"url":"https://api.github.com/repos/openshift/origin/labels/needs-api-review","name":"needs-api-review","color":"b60205","default":false},{"id":640548662,"url":"https://api.github.com/repos/openshift/origin/labels/size/XXL","name":"size/XXL","color":"ee0000","default":false}],"state":"open","locked":false,"assignee":{"login":"bparees","id":4974046,"avatar_url":"https://avatars2.githubusercontent.com/u/4974046?v=4","gravatar_id":"","url":"https://api.github.com/users/bparees","html_url":"https://github.com/bparees","followers_url":"https://api.github.com/users/bparees/followers","following_url":"https://api.github.com/users/bparees/following{/other_user}","gists_url":"https://api.github.com/users/bparees/gists{/gist_id}","starred_url":"https://api.github.com/users/bparees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bparees/subscriptions","organizations_url":"https://api.github.com/users/bparees/orgs","repos_url":"https://api.github.com/users/bparees/repos","events_url":"https://api.github.com/users/bparees/events{/privacy}","received_events_url":"https://api.github.com/users/bparees/received_events","type":"User","site_admin":false},"assignees":[{"login":"smarterclayton","id":1163175,"avatar_url":"https://avatars0.githubusercontent.com/u/1163175?v=4","gravatar_id":"","url":"https://api.github.com/users/smarterclayton","html_url":"https://github.com/smarterclayton","followers_url":"https://api.github.com/users/smarterclayton/followers","following_url":"https://api.github.com/users/smarterclayton/following{/other_user}","gists_url":"https://api.github.com/users/smarterclayton/gists{/gist_id}","starred_url":"https://api.github.com/users/smarterclayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarterclayton/subscriptions","organizations_url":"https://api.github.com/users/smarterclayton/orgs","repos_url":"https://api.github.com/users/smarterclayton/repos","events_url":"https://api.github.com/users/smarterclayton/events{/privacy}","received_events_url":"https://api.github.com/users/smarterclayton/received_events","type":"User","site_admin":false},{"login":"bparees","id":4974046,"avatar_url":"https://avatars2.githubusercontent.com/u/4974046?v=4","gravatar_id":"","url":"https://api.github.com/users/bparees","html_url":"https://github.com/bparees","followers_url":"https://api.github.com/users/bparees/followers","following_url":"https://api.github.com/users/bparees/following{/other_user}","gists_url":"https://api.github.com/users/bparees/gists{/gist_id}","starred_url":"https://api.github.com/users/bparees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bparees/subscriptions","organizations_url":"https://api.github.com/users/bparees/orgs","repos_url":"https://api.github.com/users/bparees/repos","events_url":"https://api.github.com/users/bparees/events{/privacy}","received_events_url":"https://api.github.com/users/bparees/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2017-09-05T19:35:30Z","updated_at":"2017-09-07T20:16:05Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/openshift/origin/pulls/16154","html_url":"https://github.com/openshift/origin/pull/16154","diff_url":"https://github.com/openshift/origin/pull/16154.diff","patch_url":"https://github.com/openshift/origin/pull/16154.patch"},"body":"## Overview\r\n\r\n- Introduces a new endpoint /parameterizedtemplate that generates a template with parameterized values for certain aspects of the input resources. Supports _image references_ as an aspect to parameterize. Other aspects that can be added later include name, environment variables, secret names, etc.\r\n- Adds CLI command to parameterize a list of objects or an existing template. The output of the command is a template with parameters for the aspects specified as an argument.\r\n\r\n### Examples\r\n\r\n_Parameterize existing deployment configs_\r\n```\r\noc get dc -l app=myapp -o yaml | oc parameterize --aspects=image-refs -o yaml -f - > myapp_template.yaml\r\n```\r\n\r\n_Parameterize newly generated artifacts_\r\n```\r\noc new-app https://github.com/example/repository.git -o yaml | oc parameterize --aspects=image-refs -o yaml -f - > myapp_template.yaml\r\n```\r\n\r\n## Use Cases\r\n\r\n- A developer uses a local cluster (with minishift or cluster up) to create an application locally. The application includes build configs, deployment configs, pvcs, image streams, etc. The developer would like to export the artifacts to recreate the application on a production cluster (openshift online). Some of the images referenced locally may be different than what is desired in the next environment. The developer then:\r\n  - Exports the set of local artifacts using `oc export`:\r\n     ```\r\n     oc export bc,dc,pvc,is -o yaml > myartifacts.yaml\r\n     ```\r\n  - Parameterizes the image references in the exported artifacts:\r\n     ```\r\n     oc parameterize --aspects image-refs -f myartifacts.yaml -o yaml > mytemplate.yaml\r\n     ```\r\n  - Alternatively stores the template in source control, and instantiates it in the production environment:\r\n     ```\r\n     oc new-app -f mytemplate.yaml -p MARIADB_IMAGE_REF=registry.access.redhat.com/rhscl/mariadb-101-rhel7:latest\r\n     ```\r\n\r\n- An application developer has created an application in a development cluster, they now want to promote it to staging and eventually production. Only deployment configs and artifacts related to running the application are desired. As in the previous case, the desired artifacts are exported (removing triggers from dc's and resolving images are outside the scope of this PR). The exported artifacts can then be parameterized into a template that allows modifying Docker references to the images to be used in the next environment."},"comment":{"url":"https://api.github.com/repos/openshift/origin/issues/comments/327915549","html_url":"https://github.com/openshift/origin/pull/16154#issuecomment-327915549","issue_url":"https://api.github.com/repos/openshift/origin/issues/16154","id":327915549,"user":{"login":"openshift-ci-robot","id":30189103,"avatar_url":"https://avatars1.githubusercontent.com/u/30189103?v=4","gravatar_id":"","url":"https://api.github.com/users/openshift-ci-robot","html_url":"https://github.com/openshift-ci-robot","followers_url":"https://api.github.com/users/openshift-ci-robot/followers","following_url":"https://api.github.com/users/openshift-ci-robot/following{/other_user}","gists_url":"https://api.github.com/users/openshift-ci-robot/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift-ci-robot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift-ci-robot/subscriptions","organizations_url":"https://api.github.com/users/openshift-ci-robot/orgs","repos_url":"https://api.github.com/users/openshift-ci-robot/repos","events_url":"https://api.github.com/users/openshift-ci-robot/events{/privacy}","received_events_url":"https://api.github.com/users/openshift-ci-robot/received_events","type":"User","site_admin":false},"created_at":"2017-09-07T20:16:05Z","updated_at":"2017-09-07T20:16:05Z","author_association":"NONE","body":"@csrwng: Your pull request title starts with \"[WIP]\", so the do-not-merge/work-in-progress label will be added.\n\n<details>\n\nThis label will ensure that your pull request will not be merged. Remove the prefix from your pull request title to trigger the removal of the label and allow for your pull request to be merged.\n\nInstructions for interacting with me using PR comments are available [here](https://github.com/kubernetes/community/blob/master/contributors/devel/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.\n</details>"}}
{"actor":{"display_login":"openshift-ci-robot"}}