{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/16964","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/16964/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/16964/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/16964/events","html_url":"https://github.com/kubernetes/kubernetes/pull/16964","id":115632676,"number":16964,"title":"Preserve int data when unmarshaling","user":{"login":"liggitt","id":980082,"avatar_url":"https://avatars.githubusercontent.com/u/980082?v=3","gravatar_id":"","url":"https://api.github.com/users/liggitt","html_url":"https://github.com/liggitt","followers_url":"https://api.github.com/users/liggitt/followers","following_url":"https://api.github.com/users/liggitt/following{/other_user}","gists_url":"https://api.github.com/users/liggitt/gists{/gist_id}","starred_url":"https://api.github.com/users/liggitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liggitt/subscriptions","organizations_url":"https://api.github.com/users/liggitt/orgs","repos_url":"https://api.github.com/users/liggitt/repos","events_url":"https://api.github.com/users/liggitt/events{/privacy}","received_events_url":"https://api.github.com/users/liggitt/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/cla:%20yes","name":"cla: yes","color":"bfe5bf"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/release-note-none","name":"release-note-none","color":"c2e0c6"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/size/XL","name":"size/XL","color":"ee5500"}],"state":"open","locked":false,"assignee":{"login":"jackgr","id":5607565,"avatar_url":"https://avatars.githubusercontent.com/u/5607565?v=3","gravatar_id":"","url":"https://api.github.com/users/jackgr","html_url":"https://github.com/jackgr","followers_url":"https://api.github.com/users/jackgr/followers","following_url":"https://api.github.com/users/jackgr/following{/other_user}","gists_url":"https://api.github.com/users/jackgr/gists{/gist_id}","starred_url":"https://api.github.com/users/jackgr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackgr/subscriptions","organizations_url":"https://api.github.com/users/jackgr/orgs","repos_url":"https://api.github.com/users/jackgr/repos","events_url":"https://api.github.com/users/jackgr/events{/privacy}","received_events_url":"https://api.github.com/users/jackgr/received_events","type":"User","site_admin":false},"milestone":null,"comments":26,"created_at":"2015-11-07T04:30:16Z","updated_at":"2016-04-11T20:25:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/16964","html_url":"https://github.com/kubernetes/kubernetes/pull/16964","diff_url":"https://github.com/kubernetes/kubernetes/pull/16964.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/16964.patch"},"body":"There are several places we use `json.Unmarshal` into an unstructured map (StrategicMergePatch, UnstructuredJSONScheme, many others).\r\n\r\nIn this scenario, the json package converts all numbers to float64. This exposes many of the int64 fields in our API types to corruption when the unstructured map is marshalled back to json.\r\n\r\nA simple example is a pod with an `\"activeDeadlineSeconds\": 1000000`. Trying to use `kubectl label`, `annotate`, `patch`, etc results in that int64 being converted to a float64, submitted to the server, and the server rejecting it with an error about \"cannot unmarshal number 1e+6 into Go value of type int64\"\r\n\r\nThe json package provides a way to defer conversion of numbers (`json.Decoder#UseNumber`), but does not actually do conversions to int or float. This PR makes use of that feature, and post-processes the unmarshalled map to convert json.Number objects to either int64 or float64 values"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/208543927","html_url":"https://github.com/kubernetes/kubernetes/pull/16964#issuecomment-208543927","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/16964","id":208543927,"user":{"login":"liggitt","id":980082,"avatar_url":"https://avatars.githubusercontent.com/u/980082?v=3","gravatar_id":"","url":"https://api.github.com/users/liggitt","html_url":"https://github.com/liggitt","followers_url":"https://api.github.com/users/liggitt/followers","following_url":"https://api.github.com/users/liggitt/following{/other_user}","gists_url":"https://api.github.com/users/liggitt/gists{/gist_id}","starred_url":"https://api.github.com/users/liggitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liggitt/subscriptions","organizations_url":"https://api.github.com/users/liggitt/orgs","repos_url":"https://api.github.com/users/liggitt/repos","events_url":"https://api.github.com/users/liggitt/events{/privacy}","received_events_url":"https://api.github.com/users/liggitt/received_events","type":"User","site_admin":false},"created_at":"2016-04-11T20:25:53Z","updated_at":"2016-04-11T20:25:53Z","body":"tagging per previous comment"}}