{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/42028860","id":42028860,"diff_hunk":"@@ -51,38 +51,35 @@ func ValidateHorizontalPodAutoscalerName(name string, prefix bool) (bool, string\n \treturn apivalidation.ValidateReplicationControllerName(name, prefix)\n }\n \n-func validateResourceConsumption(consumption *extensions.ResourceConsumption, fieldName string) errs.ValidationErrorList {\n+func validateMetricUtilizations(utilizations []extensions.MetricUtilization, fieldName string) errs.ValidationErrorList {\n \tallErrs := errs.ValidationErrorList{}\n-\tresource := consumption.Resource.String()\n-\tif resource != string(api.ResourceMemory) && resource != string(api.ResourceCPU) {\n-\t\tallErrs = append(allErrs, errs.NewFieldInvalid(fieldName+\".resource\", resource, \"resource not supported by autoscaler\"))\n-\t}\n-\tquantity := consumption.Quantity.Value()\n-\tif quantity < 0 {\n-\t\tallErrs = append(allErrs, errs.NewFieldInvalid(fieldName+\".quantity\", quantity, \"must be non-negative\"))\n+\tif len(utilizations) != 1 {\n+\t\tallErrs = append(allErrs, errs.NewFieldInvalid(fieldName, len(utilizations), \"must containe exactly 1 element\"))\n+\t} else {\n+\t\tname := utilizations[0].Name\n+\t\tif string(name) != string(extensions.MetricCPUUsage) && string(name) != string(extensions.MetricMemoryUsage) {\n+\t\t\tallErrs = append(allErrs, errs.NewFieldInvalid(fieldName+\".name\", name, \"metric not supported by autoscaler\"))\n+\t\t}\n+\t\tutilization := utilizations[0].Utilization.Value()\n+\t\tif utilization < 0 {\n+\t\t\tallErrs = append(allErrs, errs.NewFieldInvalid(fieldName+\".utilization\", utilization, isNegativeErrorMsg))\n+\t\t}\n \t}\n \treturn allErrs\n }\n \n func validateHorizontalPodAutoscalerSpec(autoscaler extensions.HorizontalPodAutoscalerSpec) errs.ValidationErrorList {\n \tallErrs := errs.ValidationErrorList{}\n-\tif autoscaler.MinReplicas < 0 {\n+\tif autoscaler.MinReplicas != nil && *autoscaler.MinReplicas < 0 {","path":"pkg/apis/extensions/validation/validation.go","position":32,"original_position":32,"commit_id":"d551bd5372951aa36f2d18399814b2d3e20e6c4c","original_commit_id":"d551bd5372951aa36f2d18399814b2d3e20e6c4c","user":{"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},"body":"Does MinReplicas == 0 make sense? Do you imagine using that to disable autoscaling, for instance? If it were to scale to 0, the autoscaler would currently have no signal to scale up.","created_at":"2015-10-14T18:00:29Z","updated_at":"2015-10-14T18:00:29Z","html_url":"https://github.com/kubernetes/kubernetes/pull/15549#discussion_r42028860","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15549","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/42028860"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/15549#discussion_r42028860"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15549"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15549","id":47548719,"html_url":"https://github.com/kubernetes/kubernetes/pull/15549","diff_url":"https://github.com/kubernetes/kubernetes/pull/15549.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/15549.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/15549","number":15549,"state":"open","locked":false,"title":"HorizontalPodAutoscaler and Scale subresource APIs graduated to beta.","user":{"login":"jszczepkowski","id":10820769,"avatar_url":"https://avatars.githubusercontent.com/u/10820769?v=3","gravatar_id":"","url":"https://api.github.com/users/jszczepkowski","html_url":"https://github.com/jszczepkowski","followers_url":"https://api.github.com/users/jszczepkowski/followers","following_url":"https://api.github.com/users/jszczepkowski/following{/other_user}","gists_url":"https://api.github.com/users/jszczepkowski/gists{/gist_id}","starred_url":"https://api.github.com/users/jszczepkowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jszczepkowski/subscriptions","organizations_url":"https://api.github.com/users/jszczepkowski/orgs","repos_url":"https://api.github.com/users/jszczepkowski/repos","events_url":"https://api.github.com/users/jszczepkowski/events{/privacy}","received_events_url":"https://api.github.com/users/jszczepkowski/received_events","type":"User","site_admin":false},"body":"HorizontalPodAutoscaler and Scale subresource APIs graduated to beta. Resolves #15311 & #15315.","created_at":"2015-10-13T15:29:22Z","updated_at":"2015-10-14T18:00:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"96c434215dd8a0b7f5cf5ec60eaf0217aadf1050","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":{"url":"https://api.github.com/repos/kubernetes/kubernetes/milestones/13","html_url":"https://github.com/kubernetes/kubernetes/milestones/v1.1","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones/13/labels","id":1220916,"number":13,"title":"v1.1","description":"Release 1.1.\r\n\r\nP1 features:\r\n* 250 nodes\r\n* kube-proxy perf. improvements (via IPTables)\r\n* Docker 1.8.x\r\n* Horizontal pod auto-scaling\r\n* Job Object\r\n* Schema validation in kubectl\r\n* Experimental API and API groups\r\n* Graceful pod termination\r\n","creator":{"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},"open_issues":74,"closed_issues":162,"state":"open","created_at":"2015-07-22T19:17:12Z","updated_at":"2015-10-14T17:57:29Z","due_on":"2015-09-21T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15549/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15549/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/15549/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/d551bd5372951aa36f2d18399814b2d3e20e6c4c","head":{"label":"jszczepkowski:hpa-beta","ref":"hpa-beta","sha":"d551bd5372951aa36f2d18399814b2d3e20e6c4c","user":{"login":"jszczepkowski","id":10820769,"avatar_url":"https://avatars.githubusercontent.com/u/10820769?v=3","gravatar_id":"","url":"https://api.github.com/users/jszczepkowski","html_url":"https://github.com/jszczepkowski","followers_url":"https://api.github.com/users/jszczepkowski/followers","following_url":"https://api.github.com/users/jszczepkowski/following{/other_user}","gists_url":"https://api.github.com/users/jszczepkowski/gists{/gist_id}","starred_url":"https://api.github.com/users/jszczepkowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jszczepkowski/subscriptions","organizations_url":"https://api.github.com/users/jszczepkowski/orgs","repos_url":"https://api.github.com/users/jszczepkowski/repos","events_url":"https://api.github.com/users/jszczepkowski/events{/privacy}","received_events_url":"https://api.github.com/users/jszczepkowski/received_events","type":"User","site_admin":false},"repo":{"id":30266090,"name":"kubernetes","full_name":"jszczepkowski/kubernetes","owner":{"login":"jszczepkowski","id":10820769,"avatar_url":"https://avatars.githubusercontent.com/u/10820769?v=3","gravatar_id":"","url":"https://api.github.com/users/jszczepkowski","html_url":"https://github.com/jszczepkowski","followers_url":"https://api.github.com/users/jszczepkowski/followers","following_url":"https://api.github.com/users/jszczepkowski/following{/other_user}","gists_url":"https://api.github.com/users/jszczepkowski/gists{/gist_id}","starred_url":"https://api.github.com/users/jszczepkowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jszczepkowski/subscriptions","organizations_url":"https://api.github.com/users/jszczepkowski/orgs","repos_url":"https://api.github.com/users/jszczepkowski/repos","events_url":"https://api.github.com/users/jszczepkowski/events{/privacy}","received_events_url":"https://api.github.com/users/jszczepkowski/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jszczepkowski/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/jszczepkowski/kubernetes","forks_url":"https://api.github.com/repos/jszczepkowski/kubernetes/forks","keys_url":"https://api.github.com/repos/jszczepkowski/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jszczepkowski/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jszczepkowski/kubernetes/teams","hooks_url":"https://api.github.com/repos/jszczepkowski/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/jszczepkowski/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/jszczepkowski/kubernetes/events","assignees_url":"https://api.github.com/repos/jszczepkowski/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/jszczepkowski/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/jszczepkowski/kubernetes/tags","blobs_url":"https://api.github.com/repos/jszczepkowski/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jszczepkowski/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jszczepkowski/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/jszczepkowski/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jszczepkowski/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/jszczepkowski/kubernetes/languages","stargazers_url":"https://api.github.com/repos/jszczepkowski/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/jszczepkowski/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/jszczepkowski/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/jszczepkowski/kubernetes/subscription","commits_url":"https://api.github.com/repos/jszczepkowski/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/jszczepkowski/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/jszczepkowski/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/jszczepkowski/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/jszczepkowski/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/jszczepkowski/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jszczepkowski/kubernetes/merges","archive_url":"https://api.github.com/repos/jszczepkowski/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jszczepkowski/kubernetes/downloads","issues_url":"https://api.github.com/repos/jszczepkowski/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/jszczepkowski/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/jszczepkowski/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/jszczepkowski/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jszczepkowski/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/jszczepkowski/kubernetes/releases{/id}","created_at":"2015-02-03T21:42:51Z","updated_at":"2015-02-12T20:51:30Z","pushed_at":"2015-10-14T15:01:58Z","git_url":"git://github.com/jszczepkowski/kubernetes.git","ssh_url":"git@github.com:jszczepkowski/kubernetes.git","clone_url":"https://github.com/jszczepkowski/kubernetes.git","svn_url":"https://github.com/jszczepkowski/kubernetes","homepage":"http://kubernetes.io","size":114286,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"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":"979ca2b3fe5554e2126e7ba2d846e094cc6513b6","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}","created_at":"2014-06-06T22:56:04Z","updated_at":"2015-10-14T17:45:43Z","pushed_at":"2015-10-14T17:47:07Z","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":460696,"stargazers_count":10698,"watchers_count":10698,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2709,"mirror_url":null,"open_issues_count":2042,"forks":2709,"open_issues":2042,"watchers":10698,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15549"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/15549"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/15549"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/15549/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15549/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15549/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/d551bd5372951aa36f2d18399814b2d3e20e6c4c"}}}}