{"action":"created","comment":{"url":"https://api.github.com/repos/knative/build-pipeline/pulls/comments/240650559","pull_request_review_id":183727960,"id":240650559,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MDY1MDU1OQ==","diff_hunk":"@@ -0,0 +1,59 @@\n+/*\n+Copyright 2018 The Knative Authors.\n+\n+Licensed under the Apache License, Version 2.0 (the \"License\");\n+you may not use this file except in compliance with the License.\n+You may obtain a copy of the License at\n+\n+    http://www.apache.org/licenses/LICENSE-2.0\n+\n+Unless required by applicable law or agreed to in writing, software\n+distributed under the License is distributed on an \"AS IS\" BASIS,\n+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+See the License for the specific language governing permissions and\n+limitations under the License.\n+*/\n+\n+package v1alpha1\n+\n+import (\n+\t\"fmt\"\n+\t\"strings\"\n+\n+\tcorev1 \"k8s.io/api/core/v1\"\n+)\n+\n+type PipelineResourceStorageType string\n+\n+const (\n+\t// PipelineResourceTypeGCS indicates that resource source is a GCS blob/directory.\n+\tPipelineResourceTypeGCS PipelineResourceType = \"gcs\"\n+)\n+\n+// PipelineResourceInterface interface to be implemented by different PipelineResource types\n+type PipelineStorageResourceInterface interface {\n+\tPipelineResourceInterface\n+\tGetSecretParams() []SecretParam\n+\tGetDownloadContainerSpec() ([]corev1.Container, error)\n+\tGetUploadContainerSpec() ([]corev1.Container, error)\n+\tSetDestinationDirectory(string)\n+}\n+\n+func NewStorageResource(r *PipelineResource) (PipelineStorageResourceInterface, error) {\n+\tif r.Spec.Type != PipelineResourceTypeStorage {\n+\t\treturn nil, fmt.Errorf(\"StoreResource: Cannot create a storage resource from a %s Pipeline Resource\", r.Spec.Type)\n+\t}\n+\n+\tfor _, param := range r.Spec.Params {\n+\t\tswitch {\n+\t\tcase strings.EqualFold(param.Name, \"type\"):","path":"pkg/apis/pipeline/v1alpha1/storage_resource.go","position":49,"original_position":49,"commit_id":"c6e1c6639c9d09bde6df7be73bad2df29620d5c1","original_commit_id":"c6e1c6639c9d09bde6df7be73bad2df29620d5c1","user":{"login":"bkuschel","id":6466034,"node_id":"MDQ6VXNlcjY0NjYwMzQ=","avatar_url":"https://avatars1.githubusercontent.com/u/6466034?v=4","gravatar_id":"","url":"https://api.github.com/users/bkuschel","html_url":"https://github.com/bkuschel","followers_url":"https://api.github.com/users/bkuschel/followers","following_url":"https://api.github.com/users/bkuschel/following{/other_user}","gists_url":"https://api.github.com/users/bkuschel/gists{/gist_id}","starred_url":"https://api.github.com/users/bkuschel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bkuschel/subscriptions","organizations_url":"https://api.github.com/users/bkuschel/orgs","repos_url":"https://api.github.com/users/bkuschel/repos","events_url":"https://api.github.com/users/bkuschel/events{/privacy}","received_events_url":"https://api.github.com/users/bkuschel/received_events","type":"User","site_admin":false},"body":"in the two scenarios I know about (gs and s3) the type can be derived from the protocol segment of the \"location\". Do we need type in those cases?","created_at":"2018-12-11T15:12:13Z","updated_at":"2018-12-11T15:12:14Z","html_url":"https://github.com/knative/build-pipeline/pull/321#discussion_r240650559","pull_request_url":"https://api.github.com/repos/knative/build-pipeline/pulls/321","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/knative/build-pipeline/pulls/comments/240650559"},"html":{"href":"https://github.com/knative/build-pipeline/pull/321#discussion_r240650559"},"pull_request":{"href":"https://api.github.com/repos/knative/build-pipeline/pulls/321"}}},"pull_request":{"url":"https://api.github.com/repos/knative/build-pipeline/pulls/321","id":237103284,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM3MTAzMjg0","html_url":"https://github.com/knative/build-pipeline/pull/321","diff_url":"https://github.com/knative/build-pipeline/pull/321.diff","patch_url":"https://github.com/knative/build-pipeline/pull/321.patch","issue_url":"https://api.github.com/repos/knative/build-pipeline/issues/321","number":321,"state":"open","locked":false,"title":"Add support for storage resource","user":{"login":"shashwathi","id":9938926,"node_id":"MDQ6VXNlcjk5Mzg5MjY=","avatar_url":"https://avatars0.githubusercontent.com/u/9938926?v=4","gravatar_id":"","url":"https://api.github.com/users/shashwathi","html_url":"https://github.com/shashwathi","followers_url":"https://api.github.com/users/shashwathi/followers","following_url":"https://api.github.com/users/shashwathi/following{/other_user}","gists_url":"https://api.github.com/users/shashwathi/gists{/gist_id}","starred_url":"https://api.github.com/users/shashwathi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shashwathi/subscriptions","organizations_url":"https://api.github.com/users/shashwathi/orgs","repos_url":"https://api.github.com/users/shashwathi/repos","events_url":"https://api.github.com/users/shashwathi/events{/privacy}","received_events_url":"https://api.github.com/users/shashwathi/received_events","type":"User","site_admin":false},"body":"- Add support for generic storage blob resource.\r\n- Add implementation for gcs as of now, resource declaration\r\nincludes bucket location(url), type params to configure credentials for private\r\nbucket.\r\n- If storage resource is added as input resource then updated build steps to pull\r\nthe blob storage. Params of resources are set as environment variables\r\nfor private buckets.\r\n- If storage is added as output resource then build step is added to\r\nupdate the blob to the bucket after execution of build steps.\r\n- Add documentation how to use declare resource\r\n- Refactor design output resources\r\n\r\nCo-authored-by: Maria Ntalla <mntalla@pivotal.io>\r\n\r\nFixes #124 \r\n\r\ncc @bobcatfish @pivotal-nader-ziada ","created_at":"2018-12-09T02:13:11Z","updated_at":"2018-12-11T15:12:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c74f7990e91d46cc356120f7a66e0e20471941a3","assignee":null,"assignees":[],"requested_reviewers":[{"login":"aaron-prindle","id":1951658,"node_id":"MDQ6VXNlcjE5NTE2NTg=","avatar_url":"https://avatars0.githubusercontent.com/u/1951658?v=4","gravatar_id":"","url":"https://api.github.com/users/aaron-prindle","html_url":"https://github.com/aaron-prindle","followers_url":"https://api.github.com/users/aaron-prindle/followers","following_url":"https://api.github.com/users/aaron-prindle/following{/other_user}","gists_url":"https://api.github.com/users/aaron-prindle/gists{/gist_id}","starred_url":"https://api.github.com/users/aaron-prindle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaron-prindle/subscriptions","organizations_url":"https://api.github.com/users/aaron-prindle/orgs","repos_url":"https://api.github.com/users/aaron-prindle/repos","events_url":"https://api.github.com/users/aaron-prindle/events{/privacy}","received_events_url":"https://api.github.com/users/aaron-prindle/received_events","type":"User","site_admin":false},{"login":"jessiezcc","id":37942702,"node_id":"MDQ6VXNlcjM3OTQyNzAy","avatar_url":"https://avatars2.githubusercontent.com/u/37942702?v=4","gravatar_id":"","url":"https://api.github.com/users/jessiezcc","html_url":"https://github.com/jessiezcc","followers_url":"https://api.github.com/users/jessiezcc/followers","following_url":"https://api.github.com/users/jessiezcc/following{/other_user}","gists_url":"https://api.github.com/users/jessiezcc/gists{/gist_id}","starred_url":"https://api.github.com/users/jessiezcc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessiezcc/subscriptions","organizations_url":"https://api.github.com/users/jessiezcc/orgs","repos_url":"https://api.github.com/users/jessiezcc/repos","events_url":"https://api.github.com/users/jessiezcc/events{/privacy}","received_events_url":"https://api.github.com/users/jessiezcc/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":1053663328,"node_id":"MDU6TGFiZWwxMDUzNjYzMzI4","url":"https://api.github.com/repos/knative/build-pipeline/labels/approved","name":"approved","color":"abea59","default":false},{"id":1061380224,"node_id":"MDU6TGFiZWwxMDYxMzgwMjI0","url":"https://api.github.com/repos/knative/build-pipeline/labels/size/XXL","name":"size/XXL","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/knative/build-pipeline/pulls/321/commits","review_comments_url":"https://api.github.com/repos/knative/build-pipeline/pulls/321/comments","review_comment_url":"https://api.github.com/repos/knative/build-pipeline/pulls/comments{/number}","comments_url":"https://api.github.com/repos/knative/build-pipeline/issues/321/comments","statuses_url":"https://api.github.com/repos/knative/build-pipeline/statuses/c6e1c6639c9d09bde6df7be73bad2df29620d5c1","head":{"label":"shashwathi:gcs-support","ref":"gcs-support","sha":"c6e1c6639c9d09bde6df7be73bad2df29620d5c1","user":{"login":"shashwathi","id":9938926,"node_id":"MDQ6VXNlcjk5Mzg5MjY=","avatar_url":"https://avatars0.githubusercontent.com/u/9938926?v=4","gravatar_id":"","url":"https://api.github.com/users/shashwathi","html_url":"https://github.com/shashwathi","followers_url":"https://api.github.com/users/shashwathi/followers","following_url":"https://api.github.com/users/shashwathi/following{/other_user}","gists_url":"https://api.github.com/users/shashwathi/gists{/gist_id}","starred_url":"https://api.github.com/users/shashwathi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shashwathi/subscriptions","organizations_url":"https://api.github.com/users/shashwathi/orgs","repos_url":"https://api.github.com/users/shashwathi/repos","events_url":"https://api.github.com/users/shashwathi/events{/privacy}","received_events_url":"https://api.github.com/users/shashwathi/received_events","type":"User","site_admin":false},"repo":{"id":149769954,"node_id":"MDEwOlJlcG9zaXRvcnkxNDk3Njk5NTQ=","name":"build-pipeline","full_name":"shashwathi/build-pipeline","private":false,"owner":{"login":"shashwathi","id":9938926,"node_id":"MDQ6VXNlcjk5Mzg5MjY=","avatar_url":"https://avatars0.githubusercontent.com/u/9938926?v=4","gravatar_id":"","url":"https://api.github.com/users/shashwathi","html_url":"https://github.com/shashwathi","followers_url":"https://api.github.com/users/shashwathi/followers","following_url":"https://api.github.com/users/shashwathi/following{/other_user}","gists_url":"https://api.github.com/users/shashwathi/gists{/gist_id}","starred_url":"https://api.github.com/users/shashwathi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shashwathi/subscriptions","organizations_url":"https://api.github.com/users/shashwathi/orgs","repos_url":"https://api.github.com/users/shashwathi/repos","events_url":"https://api.github.com/users/shashwathi/events{/privacy}","received_events_url":"https://api.github.com/users/shashwathi/received_events","type":"User","site_admin":false},"html_url":"https://github.com/shashwathi/build-pipeline","description":"A K8s-native Pipeline resource.","fork":true,"url":"https://api.github.com/repos/shashwathi/build-pipeline","forks_url":"https://api.github.com/repos/shashwathi/build-pipeline/forks","keys_url":"https://api.github.com/repos/shashwathi/build-pipeline/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shashwathi/build-pipeline/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shashwathi/build-pipeline/teams","hooks_url":"https://api.github.com/repos/shashwathi/build-pipeline/hooks","issue_events_url":"https://api.github.com/repos/shashwathi/build-pipeline/issues/events{/number}","events_url":"https://api.github.com/repos/shashwathi/build-pipeline/events","assignees_url":"https://api.github.com/repos/shashwathi/build-pipeline/assignees{/user}","branches_url":"https://api.github.com/repos/shashwathi/build-pipeline/branches{/branch}","tags_url":"https://api.github.com/repos/shashwathi/build-pipeline/tags","blobs_url":"https://api.github.com/repos/shashwathi/build-pipeline/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shashwathi/build-pipeline/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shashwathi/build-pipeline/git/refs{/sha}","trees_url":"https://api.github.com/repos/shashwathi/build-pipeline/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shashwathi/build-pipeline/statuses/{sha}","languages_url":"https://api.github.com/repos/shashwathi/build-pipeline/languages","stargazers_url":"https://api.github.com/repos/shashwathi/build-pipeline/stargazers","contributors_url":"https://api.github.com/repos/shashwathi/build-pipeline/contributors","subscribers_url":"https://api.github.com/repos/shashwathi/build-pipeline/subscribers","subscription_url":"https://api.github.com/repos/shashwathi/build-pipeline/subscription","commits_url":"https://api.github.com/repos/shashwathi/build-pipeline/commits{/sha}","git_commits_url":"https://api.github.com/repos/shashwathi/build-pipeline/git/commits{/sha}","comments_url":"https://api.github.com/repos/shashwathi/build-pipeline/comments{/number}","issue_comment_url":"https://api.github.com/repos/shashwathi/build-pipeline/issues/comments{/number}","contents_url":"https://api.github.com/repos/shashwathi/build-pipeline/contents/{+path}","compare_url":"https://api.github.com/repos/shashwathi/build-pipeline/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shashwathi/build-pipeline/merges","archive_url":"https://api.github.com/repos/shashwathi/build-pipeline/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shashwathi/build-pipeline/downloads","issues_url":"https://api.github.com/repos/shashwathi/build-pipeline/issues{/number}","pulls_url":"https://api.github.com/repos/shashwathi/build-pipeline/pulls{/number}","milestones_url":"https://api.github.com/repos/shashwathi/build-pipeline/milestones{/number}","notifications_url":"https://api.github.com/repos/shashwathi/build-pipeline/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shashwathi/build-pipeline/labels{/name}","releases_url":"https://api.github.com/repos/shashwathi/build-pipeline/releases{/id}","deployments_url":"https://api.github.com/repos/shashwathi/build-pipeline/deployments","created_at":"2018-09-21T13:50:22Z","updated_at":"2018-09-21T13:50:24Z","pushed_at":"2018-12-11T14:06:00Z","git_url":"git://github.com/shashwathi/build-pipeline.git","ssh_url":"git@github.com:shashwathi/build-pipeline.git","clone_url":"https://github.com/shashwathi/build-pipeline.git","svn_url":"https://github.com/shashwathi/build-pipeline","homepage":"","size":54563,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"knative:master","ref":"master","sha":"e5d408b4e9e2688b8ff34f879794248c9895e6aa","user":{"login":"knative","id":35583233,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1NTgzMjMz","avatar_url":"https://avatars2.githubusercontent.com/u/35583233?v=4","gravatar_id":"","url":"https://api.github.com/users/knative","html_url":"https://github.com/knative","followers_url":"https://api.github.com/users/knative/followers","following_url":"https://api.github.com/users/knative/following{/other_user}","gists_url":"https://api.github.com/users/knative/gists{/gist_id}","starred_url":"https://api.github.com/users/knative/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knative/subscriptions","organizations_url":"https://api.github.com/users/knative/orgs","repos_url":"https://api.github.com/users/knative/repos","events_url":"https://api.github.com/users/knative/events{/privacy}","received_events_url":"https://api.github.com/users/knative/received_events","type":"Organization","site_admin":false},"repo":{"id":146641150,"node_id":"MDEwOlJlcG9zaXRvcnkxNDY2NDExNTA=","name":"build-pipeline","full_name":"knative/build-pipeline","private":false,"owner":{"login":"knative","id":35583233,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1NTgzMjMz","avatar_url":"https://avatars2.githubusercontent.com/u/35583233?v=4","gravatar_id":"","url":"https://api.github.com/users/knative","html_url":"https://github.com/knative","followers_url":"https://api.github.com/users/knative/followers","following_url":"https://api.github.com/users/knative/following{/other_user}","gists_url":"https://api.github.com/users/knative/gists{/gist_id}","starred_url":"https://api.github.com/users/knative/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knative/subscriptions","organizations_url":"https://api.github.com/users/knative/orgs","repos_url":"https://api.github.com/users/knative/repos","events_url":"https://api.github.com/users/knative/events{/privacy}","received_events_url":"https://api.github.com/users/knative/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/knative/build-pipeline","description":"A K8s-native Pipeline resource.","fork":false,"url":"https://api.github.com/repos/knative/build-pipeline","forks_url":"https://api.github.com/repos/knative/build-pipeline/forks","keys_url":"https://api.github.com/repos/knative/build-pipeline/keys{/key_id}","collaborators_url":"https://api.github.com/repos/knative/build-pipeline/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/knative/build-pipeline/teams","hooks_url":"https://api.github.com/repos/knative/build-pipeline/hooks","issue_events_url":"https://api.github.com/repos/knative/build-pipeline/issues/events{/number}","events_url":"https://api.github.com/repos/knative/build-pipeline/events","assignees_url":"https://api.github.com/repos/knative/build-pipeline/assignees{/user}","branches_url":"https://api.github.com/repos/knative/build-pipeline/branches{/branch}","tags_url":"https://api.github.com/repos/knative/build-pipeline/tags","blobs_url":"https://api.github.com/repos/knative/build-pipeline/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/knative/build-pipeline/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/knative/build-pipeline/git/refs{/sha}","trees_url":"https://api.github.com/repos/knative/build-pipeline/git/trees{/sha}","statuses_url":"https://api.github.com/repos/knative/build-pipeline/statuses/{sha}","languages_url":"https://api.github.com/repos/knative/build-pipeline/languages","stargazers_url":"https://api.github.com/repos/knative/build-pipeline/stargazers","contributors_url":"https://api.github.com/repos/knative/build-pipeline/contributors","subscribers_url":"https://api.github.com/repos/knative/build-pipeline/subscribers","subscription_url":"https://api.github.com/repos/knative/build-pipeline/subscription","commits_url":"https://api.github.com/repos/knative/build-pipeline/commits{/sha}","git_commits_url":"https://api.github.com/repos/knative/build-pipeline/git/commits{/sha}","comments_url":"https://api.github.com/repos/knative/build-pipeline/comments{/number}","issue_comment_url":"https://api.github.com/repos/knative/build-pipeline/issues/comments{/number}","contents_url":"https://api.github.com/repos/knative/build-pipeline/contents/{+path}","compare_url":"https://api.github.com/repos/knative/build-pipeline/compare/{base}...{head}","merges_url":"https://api.github.com/repos/knative/build-pipeline/merges","archive_url":"https://api.github.com/repos/knative/build-pipeline/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/knative/build-pipeline/downloads","issues_url":"https://api.github.com/repos/knative/build-pipeline/issues{/number}","pulls_url":"https://api.github.com/repos/knative/build-pipeline/pulls{/number}","milestones_url":"https://api.github.com/repos/knative/build-pipeline/milestones{/number}","notifications_url":"https://api.github.com/repos/knative/build-pipeline/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/knative/build-pipeline/labels{/name}","releases_url":"https://api.github.com/repos/knative/build-pipeline/releases{/id}","deployments_url":"https://api.github.com/repos/knative/build-pipeline/deployments","created_at":"2018-08-29T18:21:55Z","updated_at":"2018-12-11T14:44:19Z","pushed_at":"2018-12-11T15:01:27Z","git_url":"git://github.com/knative/build-pipeline.git","ssh_url":"git@github.com:knative/build-pipeline.git","clone_url":"https://github.com/knative/build-pipeline.git","svn_url":"https://github.com/knative/build-pipeline","homepage":"","size":54501,"stargazers_count":161,"watchers_count":161,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":42,"mirror_url":null,"archived":false,"open_issues_count":56,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":42,"open_issues":56,"watchers":161,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/knative/build-pipeline/pulls/321"},"html":{"href":"https://github.com/knative/build-pipeline/pull/321"},"issue":{"href":"https://api.github.com/repos/knative/build-pipeline/issues/321"},"comments":{"href":"https://api.github.com/repos/knative/build-pipeline/issues/321/comments"},"review_comments":{"href":"https://api.github.com/repos/knative/build-pipeline/pulls/321/comments"},"review_comment":{"href":"https://api.github.com/repos/knative/build-pipeline/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/knative/build-pipeline/pulls/321/commits"},"statuses":{"href":"https://api.github.com/repos/knative/build-pipeline/statuses/c6e1c6639c9d09bde6df7be73bad2df29620d5c1"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"bkuschel"}}