{"action":"opened","number":36812,"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/36812","id":93761145,"html_url":"https://github.com/kubernetes/kubernetes/pull/36812","diff_url":"https://github.com/kubernetes/kubernetes/pull/36812.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/36812.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/36812","number":36812,"state":"open","locked":false,"title":"Change ScheduledJob POD name suffix from hash to Unix Epoch","user":{"login":"jakub-d","id":3242249,"avatar_url":"https://avatars.githubusercontent.com/u/3242249?v=3","gravatar_id":"","url":"https://api.github.com/users/jakub-d","html_url":"https://github.com/jakub-d","followers_url":"https://api.github.com/users/jakub-d/followers","following_url":"https://api.github.com/users/jakub-d/following{/other_user}","gists_url":"https://api.github.com/users/jakub-d/gists{/gist_id}","starred_url":"https://api.github.com/users/jakub-d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakub-d/subscriptions","organizations_url":"https://api.github.com/users/jakub-d/orgs","repos_url":"https://api.github.com/users/jakub-d/repos","events_url":"https://api.github.com/users/jakub-d/events{/privacy}","received_events_url":"https://api.github.com/users/jakub-d/received_events","type":"User","site_admin":false},"body":"**What this PR does / why we need it**:\r\n\r\nThere is a bug in a ScheduledJob POD suffix hash function (#34447). If you generate more than ~20 PODs you will start having collisions. Here is the code which proves that:\r\n```\r\npackage main\r\n\r\nimport \"fmt\"\r\nimport \"time\"\r\nimport \"hash/adler32\"\r\nimport hashutil \"k8s.io/kubernetes/pkg/util/hash\"\r\n\r\nfunc main() {\r\n        start_time, _ := time.Parse(\"2006-Jan-02\", \"2016-Nov-14\")\r\n        var hits map[uint32]int = make(map[uint32]int)\r\n        fmt.Println(\"| Date | Epoch | Hash | Hits |\")\r\n        fmt.Println(\"| --------------- | ---------- | --- | ---- |\")\r\n        for i:=0; i<30; i++ {\r\n                dt:=start_time.Add(time.Duration(i*5)*time.Minute)\r\n                hdt:=getTimeHash(dt)\r\n                _, ok := hits[hdt]\r\n                if ! ok {\r\n                        hits[hdt]=0\r\n                }\r\n                hits[hdt]++\r\n                fmt.Printf(\"| %s | %d | %d | %d  |\\n\",dt.Format(time.Stamp), dt.Unix(), hdt, hits[hdt])\r\n        }\r\n}\r\n\r\nfunc getTimeHash(tm time.Time) uint32 {\r\n        timeHasher := adler32.New()\r\n        hashutil.DeepHashObject(timeHasher, tm)\r\n        return timeHasher.Sum32()\r\n}\r\n```\r\n\r\nThe ouptut is:\r\n\r\n| Date | Epoch | Hash | Hits |\r\n| --------------- | ---------- | --- | ---- |\r\n| Nov 14 00:00:00 | 1479081600 | 4175643772 | 1  |\r\n| Nov 14 00:05:00 | 1479081900 | **4209853567** | 1  |\r\n| Nov 14 00:10:00 | 1479082200 | **4141499513** | 1  |\r\n| Nov 14 00:15:00 | 1479082500 | 4175709308 | 1  |\r\n| Nov 14 00:20:00 | 1479082800 | 4209919103 | 1  |\r\n| Nov 14 00:25:00 | 1479083100 | 4244128898 | 1  |\r\n| Nov 14 00:30:00 | 1479083400 | 4072621171 | 1  |\r\n| Nov 14 00:35:00 | 1479083700 | 4106830966 | 1  |\r\n| Nov 14 00:40:00 | 1479084000 | 4141040761 | 1  |\r\n| Nov 14 00:45:00 | 1479084300 | 4072686707 | 1  |\r\n| Nov 14 00:50:00 | 1479084600 | 4106896502 | 1  |\r\n| Nov 14 00:55:00 | 1479084900 | 4141106297 | 1  |\r\n| Nov 14 01:00:00 | 1479085200 | 4072752243 | 1  |\r\n| Nov 14 01:05:00 | 1479085500 | 4106962038 | 1  |\r\n| Nov 14 01:10:00 | 1479085800 | 4141171833 | 1  |\r\n| Nov 14 01:15:00 | 1479086100 | 4175381628 | 1  |\r\n| Nov 14 01:20:00 | 1479086400 | 4107027574 | 1  |\r\n| Nov 14 01:25:00 | 1479086700 | 4141237369 | 1  |\r\n| Nov 14 01:30:00 | 1479087000 | 4175447164 | 1  |\r\n| Nov 14 01:35:00 | 1479087300 | 4107093110 | 1  |\r\n| Nov 14 01:40:00 | 1479087600 | 4141302905 | 1  |\r\n| Nov 14 01:45:00 | 1479087900 | 4175512700 | 1  |\r\n| Nov 14 01:50:00 | 1479088200 | 4107158646 | 1  |\r\n| Nov 14 01:55:00 | 1479088500 | 4141368441 | 1  |\r\n| Nov 14 02:00:00 | 1479088800 | 4175578236 | 1  |\r\n| Nov 14 02:05:00 | 1479089100 | 4209788031 | 1  |\r\n| Nov 14 02:10:00 | 1479089400 | 4141433977 | 1  |\r\n| Nov 14 02:15:00 | 1479089700 | 4175643772 | 2  |\r\n| Nov 14 02:20:00 | 1479090000 | **4209853567** | 2  |\r\n| Nov 14 02:25:00 | 1479090300 | **4141499513** | 2  |\r\n\r\nThis PR is a proposal to abandon hashes and use Unix Epoch times instead.\r\nCons:\r\n* It's easy to sort PODs this way\r\n* The length of the Epoch time stamp is the same as the length of the current hash\r\n* As it's epoch - we won't have collisions\r\n\r\n**Which issue this PR fixes**\r\nfixes #34447","created_at":"2016-11-15T13:02:11Z","updated_at":"2016-11-15T13:02:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/36812/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/36812/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/36812/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/daa23a63e8a0fa98d185bc9e2155874bf967a906","head":{"label":"jakub-d:master","ref":"master","sha":"daa23a63e8a0fa98d185bc9e2155874bf967a906","user":{"login":"jakub-d","id":3242249,"avatar_url":"https://avatars.githubusercontent.com/u/3242249?v=3","gravatar_id":"","url":"https://api.github.com/users/jakub-d","html_url":"https://github.com/jakub-d","followers_url":"https://api.github.com/users/jakub-d/followers","following_url":"https://api.github.com/users/jakub-d/following{/other_user}","gists_url":"https://api.github.com/users/jakub-d/gists{/gist_id}","starred_url":"https://api.github.com/users/jakub-d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakub-d/subscriptions","organizations_url":"https://api.github.com/users/jakub-d/orgs","repos_url":"https://api.github.com/users/jakub-d/repos","events_url":"https://api.github.com/users/jakub-d/events{/privacy}","received_events_url":"https://api.github.com/users/jakub-d/received_events","type":"User","site_admin":false},"repo":{"id":73703975,"name":"kubernetes","full_name":"jakub-d/kubernetes","owner":{"login":"jakub-d","id":3242249,"avatar_url":"https://avatars.githubusercontent.com/u/3242249?v=3","gravatar_id":"","url":"https://api.github.com/users/jakub-d","html_url":"https://github.com/jakub-d","followers_url":"https://api.github.com/users/jakub-d/followers","following_url":"https://api.github.com/users/jakub-d/following{/other_user}","gists_url":"https://api.github.com/users/jakub-d/gists{/gist_id}","starred_url":"https://api.github.com/users/jakub-d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakub-d/subscriptions","organizations_url":"https://api.github.com/users/jakub-d/orgs","repos_url":"https://api.github.com/users/jakub-d/repos","events_url":"https://api.github.com/users/jakub-d/events{/privacy}","received_events_url":"https://api.github.com/users/jakub-d/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jakub-d/kubernetes","description":"Production-Grade Container Scheduling and Management","fork":true,"url":"https://api.github.com/repos/jakub-d/kubernetes","forks_url":"https://api.github.com/repos/jakub-d/kubernetes/forks","keys_url":"https://api.github.com/repos/jakub-d/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jakub-d/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jakub-d/kubernetes/teams","hooks_url":"https://api.github.com/repos/jakub-d/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/jakub-d/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/jakub-d/kubernetes/events","assignees_url":"https://api.github.com/repos/jakub-d/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/jakub-d/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/jakub-d/kubernetes/tags","blobs_url":"https://api.github.com/repos/jakub-d/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jakub-d/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jakub-d/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/jakub-d/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jakub-d/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/jakub-d/kubernetes/languages","stargazers_url":"https://api.github.com/repos/jakub-d/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/jakub-d/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/jakub-d/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/jakub-d/kubernetes/subscription","commits_url":"https://api.github.com/repos/jakub-d/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/jakub-d/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/jakub-d/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/jakub-d/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/jakub-d/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/jakub-d/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jakub-d/kubernetes/merges","archive_url":"https://api.github.com/repos/jakub-d/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jakub-d/kubernetes/downloads","issues_url":"https://api.github.com/repos/jakub-d/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/jakub-d/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/jakub-d/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/jakub-d/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jakub-d/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/jakub-d/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/jakub-d/kubernetes/deployments","created_at":"2016-11-14T12:48:26Z","updated_at":"2016-11-14T12:49:06Z","pushed_at":"2016-11-15T12:36:26Z","git_url":"git://github.com/jakub-d/kubernetes.git","ssh_url":"git@github.com:jakub-d/kubernetes.git","clone_url":"https://github.com/jakub-d/kubernetes.git","svn_url":"https://github.com/jakub-d/kubernetes","homepage":"http://kubernetes.io","size":629761,"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":"2bd8bb26995a82282afd63c57173df00c781015d","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":"Production-Grade Container Scheduling and Management","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-11-15T11:07:05Z","pushed_at":"2016-11-15T12:57:10Z","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":630654,"stargazers_count":18413,"watchers_count":18413,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6062,"mirror_url":null,"open_issues_count":5301,"forks":6062,"open_issues":5301,"watchers":18413,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/36812"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/36812"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/36812"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/36812/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/36812/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/36812/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/daa23a63e8a0fa98d185bc9e2155874bf967a906"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":1,"review_comments":0,"commits":1,"additions":3,"deletions":6,"changed_files":1}}
{"actor":{"display_login":"jakub-d"}}