{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/52720091","id":52720091,"diff_hunk":"@@ -83,6 +88,18 @@ func RunPatch(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []stri\n \t\treturn err\n \t}\n \n+\tpatchType := api.StrategicMergePatchType\n+\tpatchTypeString := strings.ToLower(cmdutil.GetFlagString(cmd, \"type\"))\n+\tif len(patchTypeString) == 0 {\n+\t\tpatchType = api.StrategicMergePatchType\n+\t} else {","path":"pkg/kubectl/cmd/patch.go","position":37,"original_position":37,"commit_id":"2f9bf0117e93f0888407068e9543669ecd824015","original_commit_id":"2f9bf0117e93f0888407068e9543669ecd824015","user":{"login":"ghodss","id":5209643,"avatar_url":"https://avatars.githubusercontent.com/u/5209643?v=3","gravatar_id":"","url":"https://api.github.com/users/ghodss","html_url":"https://github.com/ghodss","followers_url":"https://api.github.com/users/ghodss/followers","following_url":"https://api.github.com/users/ghodss/following{/other_user}","gists_url":"https://api.github.com/users/ghodss/gists{/gist_id}","starred_url":"https://api.github.com/users/ghodss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghodss/subscriptions","organizations_url":"https://api.github.com/users/ghodss/orgs","repos_url":"https://api.github.com/users/ghodss/repos","events_url":"https://api.github.com/users/ghodss/events{/privacy}","received_events_url":"https://api.github.com/users/ghodss/received_events","type":"User","site_admin":false},"body":"Can you just make this line `if len(patchTypeString) != 0 {` and delete the two lines above it?","created_at":"2016-02-12T09:29:55Z","updated_at":"2016-02-12T09:29:55Z","html_url":"https://github.com/kubernetes/kubernetes/pull/21099#discussion_r52720091","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/21099","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/52720091"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/21099#discussion_r52720091"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/21099"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/21099","id":59092147,"html_url":"https://github.com/kubernetes/kubernetes/pull/21099","diff_url":"https://github.com/kubernetes/kubernetes/pull/21099.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/21099.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/21099","number":21099,"state":"open","locked":false,"title":"allow patch to handle multiple types","user":{"login":"deads2k","id":8225098,"avatar_url":"https://avatars.githubusercontent.com/u/8225098?v=3","gravatar_id":"","url":"https://api.github.com/users/deads2k","html_url":"https://github.com/deads2k","followers_url":"https://api.github.com/users/deads2k/followers","following_url":"https://api.github.com/users/deads2k/following{/other_user}","gists_url":"https://api.github.com/users/deads2k/gists{/gist_id}","starred_url":"https://api.github.com/users/deads2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deads2k/subscriptions","organizations_url":"https://api.github.com/users/deads2k/orgs","repos_url":"https://api.github.com/users/deads2k/repos","events_url":"https://api.github.com/users/deads2k/events{/privacy}","received_events_url":"https://api.github.com/users/deads2k/received_events","type":"User","site_admin":false},"body":"Right now `kubectl patch` only supports strategic merge patch, but its easier to express some kinds of changes using different patch types.  For instance, updates to positional arrays are very easy with a `json` patch type.  This adds the ability to choose a patch type.\r\n\r\n@kubernetes/kubectl @YannMoisan","created_at":"2016-02-11T20:55:06Z","updated_at":"2016-02-12T09:29:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"54df5dd3df727a0b34853024951dc712ac635889","assignee":{"login":"bgrant0607","id":7725777,"avatar_url":"https://avatars.githubusercontent.com/u/7725777?v=3","gravatar_id":"","url":"https://api.github.com/users/bgrant0607","html_url":"https://github.com/bgrant0607","followers_url":"https://api.github.com/users/bgrant0607/followers","following_url":"https://api.github.com/users/bgrant0607/following{/other_user}","gists_url":"https://api.github.com/users/bgrant0607/gists{/gist_id}","starred_url":"https://api.github.com/users/bgrant0607/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgrant0607/subscriptions","organizations_url":"https://api.github.com/users/bgrant0607/orgs","repos_url":"https://api.github.com/users/bgrant0607/repos","events_url":"https://api.github.com/users/bgrant0607/events{/privacy}","received_events_url":"https://api.github.com/users/bgrant0607/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/21099/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/21099/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/21099/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/2f9bf0117e93f0888407068e9543669ecd824015","head":{"label":"deads2k:extend-patch","ref":"extend-patch","sha":"2f9bf0117e93f0888407068e9543669ecd824015","user":{"login":"deads2k","id":8225098,"avatar_url":"https://avatars.githubusercontent.com/u/8225098?v=3","gravatar_id":"","url":"https://api.github.com/users/deads2k","html_url":"https://github.com/deads2k","followers_url":"https://api.github.com/users/deads2k/followers","following_url":"https://api.github.com/users/deads2k/following{/other_user}","gists_url":"https://api.github.com/users/deads2k/gists{/gist_id}","starred_url":"https://api.github.com/users/deads2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deads2k/subscriptions","organizations_url":"https://api.github.com/users/deads2k/orgs","repos_url":"https://api.github.com/users/deads2k/repos","events_url":"https://api.github.com/users/deads2k/events{/privacy}","received_events_url":"https://api.github.com/users/deads2k/received_events","type":"User","site_admin":false},"repo":{"id":24939417,"name":"kubernetes","full_name":"deads2k/kubernetes","owner":{"login":"deads2k","id":8225098,"avatar_url":"https://avatars.githubusercontent.com/u/8225098?v=3","gravatar_id":"","url":"https://api.github.com/users/deads2k","html_url":"https://github.com/deads2k","followers_url":"https://api.github.com/users/deads2k/followers","following_url":"https://api.github.com/users/deads2k/following{/other_user}","gists_url":"https://api.github.com/users/deads2k/gists{/gist_id}","starred_url":"https://api.github.com/users/deads2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deads2k/subscriptions","organizations_url":"https://api.github.com/users/deads2k/orgs","repos_url":"https://api.github.com/users/deads2k/repos","events_url":"https://api.github.com/users/deads2k/events{/privacy}","received_events_url":"https://api.github.com/users/deads2k/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/deads2k/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/deads2k/kubernetes","forks_url":"https://api.github.com/repos/deads2k/kubernetes/forks","keys_url":"https://api.github.com/repos/deads2k/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/deads2k/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/deads2k/kubernetes/teams","hooks_url":"https://api.github.com/repos/deads2k/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/deads2k/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/deads2k/kubernetes/events","assignees_url":"https://api.github.com/repos/deads2k/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/deads2k/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/deads2k/kubernetes/tags","blobs_url":"https://api.github.com/repos/deads2k/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/deads2k/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/deads2k/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/deads2k/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/deads2k/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/deads2k/kubernetes/languages","stargazers_url":"https://api.github.com/repos/deads2k/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/deads2k/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/deads2k/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/deads2k/kubernetes/subscription","commits_url":"https://api.github.com/repos/deads2k/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/deads2k/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/deads2k/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/deads2k/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/deads2k/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/deads2k/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/deads2k/kubernetes/merges","archive_url":"https://api.github.com/repos/deads2k/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/deads2k/kubernetes/downloads","issues_url":"https://api.github.com/repos/deads2k/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/deads2k/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/deads2k/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/deads2k/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/deads2k/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/deads2k/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/deads2k/kubernetes/deployments","created_at":"2014-10-08T12:24:01Z","updated_at":"2016-01-11T16:12:51Z","pushed_at":"2016-02-11T20:53:24Z","git_url":"git://github.com/deads2k/kubernetes.git","ssh_url":"git@github.com:deads2k/kubernetes.git","clone_url":"https://github.com/deads2k/kubernetes.git","svn_url":"https://github.com/deads2k/kubernetes","homepage":null,"size":161467,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"1478cf345a1f1022e7e36d027dcc441a3f72b51c","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"kubernetes/kubernetes","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes/kubernetes","description":"Container Cluster Manager from Google","fork":false,"url":"https://api.github.com/repos/kubernetes/kubernetes","forks_url":"https://api.github.com/repos/kubernetes/kubernetes/forks","keys_url":"https://api.github.com/repos/kubernetes/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/kubernetes/teams","hooks_url":"https://api.github.com/repos/kubernetes/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/kubernetes/events","assignees_url":"https://api.github.com/repos/kubernetes/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/kubernetes/tags","blobs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/kubernetes/languages","stargazers_url":"https://api.github.com/repos/kubernetes/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/kubernetes/subscription","commits_url":"https://api.github.com/repos/kubernetes/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/kubernetes/merges","archive_url":"https://api.github.com/repos/kubernetes/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/kubernetes/downloads","issues_url":"https://api.github.com/repos/kubernetes/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes/kubernetes/deployments","created_at":"2014-06-06T22:56:04Z","updated_at":"2016-02-12T08:28:43Z","pushed_at":"2016-02-12T09:28:46Z","git_url":"git://github.com/kubernetes/kubernetes.git","ssh_url":"git@github.com:kubernetes/kubernetes.git","clone_url":"https://github.com/kubernetes/kubernetes.git","svn_url":"https://github.com/kubernetes/kubernetes","homepage":"http://kubernetes.io","size":322774,"stargazers_count":12627,"watchers_count":12627,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3597,"mirror_url":null,"open_issues_count":2841,"forks":3597,"open_issues":2841,"watchers":12627,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/21099"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/21099"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/21099"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/21099/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/21099/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/21099/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/2f9bf0117e93f0888407068e9543669ecd824015"}}}}