{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/41602568","id":41602568,"diff_hunk":"@@ -639,3 +639,36 @@ type ClusterAutoscalerList struct {\n \n \tItems []ClusterAutoscaler `json:\"items\"`\n }\n+\n+// Selector is a label query over a set of API objects. MatchLabels and\n+// MatchExpressions are ANDed. An empty Selector matches all objects. A\n+// null Selector matches no objects.\n+type Selector struct {\n+\t// MatchLabels is a list of labels.\n+\tMatchLabels map[string]string `json:\"matchLabels,omitempty\"`\n+\t// MatchExpressions is a list of requirement selectors.\n+\tMatchExpressions []SelectorRequirement `json:\"matchExpressions,omitempty\"`\n+}\n+\n+// SelectorRequirement is a selector that contains values, a key\n+// and an operator that relates the key and values.\n+type SelectorRequirement struct {\n+\t// Key is the label key that the selector applies to.\n+\tKey string `json:\"key\"`\n+\t// Operator represents a key's relationship\n+\t// to a set of values.\n+\tOperator SelectorOperator `json:\"operator\"`\n+\t// StringValues is a set of string values. If the operator is In or NotIn,\n+\t// the values set must be non-empty.\n+\tStringValues []string `json:\"stringValues,omitempty\"`\n+}\n+\n+// SelectorOperator is the set of operators that can be used in\n+// a selector requirement.\n+type SelectorOperator string\n+\n+const (\n+\tSelectorOpIn     SelectorOperator = \"In\"\n+\tSelectorOpNotIn  SelectorOperator = \"NotIn\"\n+\tSelectorOpExists SelectorOperator = \"Exists\"","path":"pkg/apis/experimental/types.go","position":35,"original_position":35,"commit_id":"974b6abe6e9b7f8f4a589b564c285cb9b69001da","original_commit_id":"974b6abe6e9b7f8f4a589b564c285cb9b69001da","user":{"login":"davidopp","id":8264113,"avatar_url":"https://avatars.githubusercontent.com/u/8264113?v=3","gravatar_id":"","url":"https://api.github.com/users/davidopp","html_url":"https://github.com/davidopp","followers_url":"https://api.github.com/users/davidopp/followers","following_url":"https://api.github.com/users/davidopp/following{/other_user}","gists_url":"https://api.github.com/users/davidopp/gists{/gist_id}","starred_url":"https://api.github.com/users/davidopp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidopp/subscriptions","organizations_url":"https://api.github.com/users/davidopp/orgs","repos_url":"https://api.github.com/users/davidopp/repos","events_url":"https://api.github.com/users/davidopp/events{/privacy}","received_events_url":"https://api.github.com/users/davidopp/received_events","type":"User","site_admin":false},"body":"What are the semantics of \"Exists\"? Does it mean \"require that this key exists, ignore the value\"? If so, that's reasonable (and we should have that) -- but shouldn't we also have \"DoesNotExist\" (\"require that this key does not exist\")? \r\n\r\nAlso, I'd strongly suggest that we have the standard numeric comparison operators. (Where the first value of the StringValues array is interpreted as a floating point number, and the rest of the array is ignored) I think there are a lot of potential use cases for this when the selector is being used as a nodeSelector for a pod, especially on bare metal environments where the cluster admin may not want to hide hardware specs from the user. It's true that in many cases you could just represent that as a new resource, but that requires more work than just adding a label to the node. Also, I think there are scenarios we might not foresee now, were numeric comparison would be useful.","created_at":"2015-10-09T07:08:00Z","updated_at":"2015-10-09T07:08:00Z","html_url":"https://github.com/kubernetes/kubernetes/pull/15350#discussion_r41602568","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15350","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/41602568"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/15350#discussion_r41602568"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15350"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15350","id":47231166,"html_url":"https://github.com/kubernetes/kubernetes/pull/15350","diff_url":"https://github.com/kubernetes/kubernetes/pull/15350.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/15350.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/15350","number":15350,"state":"open","locked":false,"title":"add generalized label selector to the experimental API","user":{"login":"mikedanese","id":1787169,"avatar_url":"https://avatars.githubusercontent.com/u/1787169?v=3","gravatar_id":"","url":"https://api.github.com/users/mikedanese","html_url":"https://github.com/mikedanese","followers_url":"https://api.github.com/users/mikedanese/followers","following_url":"https://api.github.com/users/mikedanese/following{/other_user}","gists_url":"https://api.github.com/users/mikedanese/gists{/gist_id}","starred_url":"https://api.github.com/users/mikedanese/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikedanese/subscriptions","organizations_url":"https://api.github.com/users/mikedanese/orgs","repos_url":"https://api.github.com/users/mikedanese/repos","events_url":"https://api.github.com/users/mikedanese/events{/privacy}","received_events_url":"https://api.github.com/users/mikedanese/received_events","type":"User","site_admin":false},"body":"Copied from #341, godoc is WIP","created_at":"2015-10-09T03:34:00Z","updated_at":"2015-10-09T07:08:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"99bb242ef473715f353f73edda255b17b90b747b","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/15350/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15350/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/15350/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/974b6abe6e9b7f8f4a589b564c285cb9b69001da","head":{"label":"mikedanese:gls-api","ref":"gls-api","sha":"974b6abe6e9b7f8f4a589b564c285cb9b69001da","user":{"login":"mikedanese","id":1787169,"avatar_url":"https://avatars.githubusercontent.com/u/1787169?v=3","gravatar_id":"","url":"https://api.github.com/users/mikedanese","html_url":"https://github.com/mikedanese","followers_url":"https://api.github.com/users/mikedanese/followers","following_url":"https://api.github.com/users/mikedanese/following{/other_user}","gists_url":"https://api.github.com/users/mikedanese/gists{/gist_id}","starred_url":"https://api.github.com/users/mikedanese/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikedanese/subscriptions","organizations_url":"https://api.github.com/users/mikedanese/orgs","repos_url":"https://api.github.com/users/mikedanese/repos","events_url":"https://api.github.com/users/mikedanese/events{/privacy}","received_events_url":"https://api.github.com/users/mikedanese/received_events","type":"User","site_admin":false},"repo":{"id":26203986,"name":"kubernetes","full_name":"mikedanese/kubernetes","owner":{"login":"mikedanese","id":1787169,"avatar_url":"https://avatars.githubusercontent.com/u/1787169?v=3","gravatar_id":"","url":"https://api.github.com/users/mikedanese","html_url":"https://github.com/mikedanese","followers_url":"https://api.github.com/users/mikedanese/followers","following_url":"https://api.github.com/users/mikedanese/following{/other_user}","gists_url":"https://api.github.com/users/mikedanese/gists{/gist_id}","starred_url":"https://api.github.com/users/mikedanese/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikedanese/subscriptions","organizations_url":"https://api.github.com/users/mikedanese/orgs","repos_url":"https://api.github.com/users/mikedanese/repos","events_url":"https://api.github.com/users/mikedanese/events{/privacy}","received_events_url":"https://api.github.com/users/mikedanese/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mikedanese/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/mikedanese/kubernetes","forks_url":"https://api.github.com/repos/mikedanese/kubernetes/forks","keys_url":"https://api.github.com/repos/mikedanese/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mikedanese/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mikedanese/kubernetes/teams","hooks_url":"https://api.github.com/repos/mikedanese/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/mikedanese/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/mikedanese/kubernetes/events","assignees_url":"https://api.github.com/repos/mikedanese/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/mikedanese/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/mikedanese/kubernetes/tags","blobs_url":"https://api.github.com/repos/mikedanese/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mikedanese/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mikedanese/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/mikedanese/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mikedanese/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/mikedanese/kubernetes/languages","stargazers_url":"https://api.github.com/repos/mikedanese/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/mikedanese/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/mikedanese/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/mikedanese/kubernetes/subscription","commits_url":"https://api.github.com/repos/mikedanese/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/mikedanese/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/mikedanese/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/mikedanese/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/mikedanese/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/mikedanese/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mikedanese/kubernetes/merges","archive_url":"https://api.github.com/repos/mikedanese/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mikedanese/kubernetes/downloads","issues_url":"https://api.github.com/repos/mikedanese/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/mikedanese/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/mikedanese/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/mikedanese/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mikedanese/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/mikedanese/kubernetes/releases{/id}","created_at":"2014-11-05T05:02:25Z","updated_at":"2015-04-15T00:20:12Z","pushed_at":"2015-10-09T04:21:34Z","git_url":"git://github.com/mikedanese/kubernetes.git","ssh_url":"git@github.com:mikedanese/kubernetes.git","clone_url":"https://github.com/mikedanese/kubernetes.git","svn_url":"https://github.com/mikedanese/kubernetes","homepage":null,"size":113993,"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":"b30600f163ecb15b0d7d81981921795ab4b99093","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-09T06:39:19Z","pushed_at":"2015-10-09T07:03:02Z","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":447654,"stargazers_count":10609,"watchers_count":10609,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2671,"mirror_url":null,"open_issues_count":2001,"forks":2671,"open_issues":2001,"watchers":10609,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15350"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/15350"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/15350"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/15350/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15350/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15350/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/974b6abe6e9b7f8f4a589b564c285cb9b69001da"}}}}