{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/25342","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/25342/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/25342/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/25342/events","html_url":"https://github.com/kubernetes/kubernetes/pull/25342","id":153738137,"number":25342,"title":"bugfix: prevent API server cache list/watch from other namespaces","user":{"login":"mqliang","id":12423751,"avatar_url":"https://avatars.githubusercontent.com/u/12423751?v=3","gravatar_id":"","url":"https://api.github.com/users/mqliang","html_url":"https://github.com/mqliang","followers_url":"https://api.github.com/users/mqliang/followers","following_url":"https://api.github.com/users/mqliang/following{/other_user}","gists_url":"https://api.github.com/users/mqliang/gists{/gist_id}","starred_url":"https://api.github.com/users/mqliang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mqliang/subscriptions","organizations_url":"https://api.github.com/users/mqliang/orgs","repos_url":"https://api.github.com/users/mqliang/repos","events_url":"https://api.github.com/users/mqliang/events{/privacy}","received_events_url":"https://api.github.com/users/mqliang/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/lgtm","name":"lgtm","color":"15dd18"},{"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/L","name":"size/L","color":"ee9900"}],"state":"open","locked":false,"assignee":{"login":"wojtek-t","id":10743879,"avatar_url":"https://avatars.githubusercontent.com/u/10743879?v=3","gravatar_id":"","url":"https://api.github.com/users/wojtek-t","html_url":"https://github.com/wojtek-t","followers_url":"https://api.github.com/users/wojtek-t/followers","following_url":"https://api.github.com/users/wojtek-t/following{/other_user}","gists_url":"https://api.github.com/users/wojtek-t/gists{/gist_id}","starred_url":"https://api.github.com/users/wojtek-t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wojtek-t/subscriptions","organizations_url":"https://api.github.com/users/wojtek-t/orgs","repos_url":"https://api.github.com/users/wojtek-t/repos","events_url":"https://api.github.com/users/wojtek-t/events{/privacy}","received_events_url":"https://api.github.com/users/wojtek-t/received_events","type":"User","site_admin":false},"assignees":[{"login":"wojtek-t","id":10743879,"avatar_url":"https://avatars.githubusercontent.com/u/10743879?v=3","gravatar_id":"","url":"https://api.github.com/users/wojtek-t","html_url":"https://github.com/wojtek-t","followers_url":"https://api.github.com/users/wojtek-t/followers","following_url":"https://api.github.com/users/wojtek-t/following{/other_user}","gists_url":"https://api.github.com/users/wojtek-t/gists{/gist_id}","starred_url":"https://api.github.com/users/wojtek-t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wojtek-t/subscriptions","organizations_url":"https://api.github.com/users/wojtek-t/orgs","repos_url":"https://api.github.com/users/wojtek-t/repos","events_url":"https://api.github.com/users/wojtek-t/events{/privacy}","received_events_url":"https://api.github.com/users/wojtek-t/received_events","type":"User","site_admin":false}],"milestone":null,"comments":17,"created_at":"2016-05-09T09:37:59Z","updated_at":"2016-07-07T16:12:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/25342","html_url":"https://github.com/kubernetes/kubernetes/pull/25342","diff_url":"https://github.com/kubernetes/kubernetes/pull/25342.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/25342.patch"},"body":"The previous code has a issue: \r\n\r\nAssume we have two namespaces `ns1` and `ns11`, when client list/watch key `/registry/pods/ns1`, API server cache will also return pods in `ns11`, since `ns1` is a prefix of `ns11`\r\n\r\nThis PR fix this issue. @wojtek-t "},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/231128532","html_url":"https://github.com/kubernetes/kubernetes/pull/25342#issuecomment-231128532","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/25342","id":231128532,"user":{"login":"wojtek-t","id":10743879,"avatar_url":"https://avatars.githubusercontent.com/u/10743879?v=3","gravatar_id":"","url":"https://api.github.com/users/wojtek-t","html_url":"https://github.com/wojtek-t","followers_url":"https://api.github.com/users/wojtek-t/followers","following_url":"https://api.github.com/users/wojtek-t/following{/other_user}","gists_url":"https://api.github.com/users/wojtek-t/gists{/gist_id}","starred_url":"https://api.github.com/users/wojtek-t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wojtek-t/subscriptions","organizations_url":"https://api.github.com/users/wojtek-t/orgs","repos_url":"https://api.github.com/users/wojtek-t/repos","events_url":"https://api.github.com/users/wojtek-t/events{/privacy}","received_events_url":"https://api.github.com/users/wojtek-t/received_events","type":"User","site_admin":false},"created_at":"2016-07-07T16:12:53Z","updated_at":"2016-07-07T16:12:53Z","body":"@mqliang - it seems the test you added is flaky:\r\n```\r\nk8s.io/kubernetes/pkg/storage TestWatchList 1.50s\r\n go test -v k8s.io/kubernetes/pkg/storage -run TestWatchList$\r\n\r\ncacher_test.go:182: (called from line 353)\r\ncacher_test.go:183: Expected (ADDED): &api.Pod{TypeMeta:unversioned.TypeMeta{Kind:\"\", APIVersion:\"\"}, ObjectMeta:api.ObjectMeta{Name:\"foo\", GenerateName:\"\", Namespace:\"ns\", SelfLink:\"\", UID:\"\", ResourceVersion:\"\", Generation:0, CreationTimestamp:unversioned.Time{Time:time.Time{sec:0, nsec:0, loc:(*time.Location)(nil)}}, DeletionTimestamp:(*unversioned.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]api.OwnerReference(nil), Finalizers:[]string(nil)}, Spec:api.PodSpec{Volumes:[]api.Volume(nil), InitContainers:[]api.Container(nil), Containers:[]api.Container(nil), RestartPolicy:\"Always\", TerminationGracePeriodSeconds:(*int64)(0xc82031fbf8), ActiveDeadlineSeconds:(*int64)(nil), DNSPolicy:\"ClusterFirst\", NodeSelector:map[string]string(nil), ServiceAccountName:\"\", NodeName:\"fakeNode\", SecurityContext:(*api.PodSecurityContext)(0xc82081ab00), ImagePullSecrets:[]api.LocalObjectReference(nil), Hostname:\"\", Subdomain:\"\"}, Status:api.PodStatus{Phase:\"\", Conditions:[]api.PodCondition(nil), Message:\"\", Reason:\"\", HostIP:\"\", PodIP:\"\", StartTime:(*unversioned.Time)(nil), InitContainerStatuses:[]api.ContainerStatus(nil), ContainerStatuses:[]api.ContainerStatus(nil)}}, got: &api.Pod{TypeMeta:unversioned.TypeMeta{Kind:\"\", APIVersion:\"\"}, ObjectMeta:api.ObjectMeta{Name:\"bar\", GenerateName:\"\", Namespace:\"ns\", SelfLink:\"\", UID:\"\", ResourceVersion:\"5\", Generation:0, CreationTimestamp:unversioned.Time{Time:time.Time{sec:0, nsec:0, loc:(*time.Location)(nil)}}, DeletionTimestamp:(*unversioned.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]api.OwnerReference(nil), Finalizers:[]string(nil)}, Spec:api.PodSpec{Volumes:[]api.Volume(nil), InitContainers:[]api.Container(nil), Containers:[]api.Container(nil), RestartPolicy:\"Always\", TerminationGracePeriodSeconds:(*int64)(0xc8202e3690), ActiveDeadlineSeconds:(*int64)(nil), DNSPolicy:\"ClusterFirst\", NodeSelector:map[string]string(nil), ServiceAccountName:\"\", NodeName:\"\", SecurityContext:(*api.PodSecurityContext)(0xc8208e5d00), ImagePullSecrets:[]api.LocalObjectReference(nil), Hostname:\"\", Subdomain:\"\"}, Status:api.PodStatus{Phase:\"\", Conditions:[]api.PodCondition(nil), Message:\"\", Reason:\"\", HostIP:\"\", PodIP:\"\", StartTime:(*unversioned.Time)(nil), InitContainerStatuses:[]api.ContainerStatus(nil), ContainerStatuses:[]api.ContainerStatus(nil)}}\r\ncacher_test.go:182: (called from line 357)\r\ncacher_test.go:183: Expected (ADDED): &api.Pod{TypeMeta:unversioned.TypeMeta{Kind:\"\", APIVersion:\"\"}, ObjectMeta:api.ObjectMeta{Name:\"bar\", GenerateName:\"\", Namespace:\"ns\", SelfLink:\"\", UID:\"\", ResourceVersion:\"\", Generation:0, CreationTimestamp:unversioned.Time{Time:time.Time{sec:0, nsec:0, loc:(*time.Location)(nil)}}, DeletionTimestamp:(*unversioned.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]api.OwnerReference(nil), Finalizers:[]string(nil)}, Spec:api.PodSpec{Volumes:[]api.Volume(nil), InitContainers:[]api.Container(nil), Containers:[]api.Container(nil), RestartPolicy:\"Always\", TerminationGracePeriodSeconds:(*int64)(0xc82031fbe0), ActiveDeadlineSeconds:(*int64)(nil), DNSPolicy:\"ClusterFirst\", NodeSelector:map[string]string(nil), ServiceAccountName:\"\", NodeName:\"\", SecurityContext:(*api.PodSecurityContext)(0xc82081aa40), ImagePullSecrets:[]api.LocalObjectReference(nil), Hostname:\"\", Subdomain:\"\"}, Status:api.PodStatus{Phase:\"\", Conditions:[]api.PodCondition(nil), Message:\"\", Reason:\"\", HostIP:\"\", PodIP:\"\", StartTime:(*unversioned.Time)(nil), InitContainerStatuses:[]api.ContainerStatus(nil), ContainerStatuses:[]api.ContainerStatus(nil)}}, got: &api.Pod{TypeMeta:unversioned.TypeMeta{Kind:\"\", APIVersion:\"\"}, ObjectMeta:api.ObjectMeta{Name:\"foo\", GenerateName:\"\", Namespace:\"ns\", SelfLink:\"\", UID:\"\", ResourceVersion:\"8\", Generation:0, CreationTimestamp:unversioned.Time{Time:time.Time{sec:0, nsec:0, loc:(*time.Location)(nil)}}, DeletionTimestamp:(*unversioned.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]api.OwnerReference(nil), Finalizers:[]string(nil)}, Spec:api.PodSpec{Volumes:[]api.Volume(nil), InitContainers:[]api.Container(nil), Containers:[]api.Container(nil), RestartPolicy:\"Always\", TerminationGracePeriodSeconds:(*int64)(0xc8202e3698), ActiveDeadlineSeconds:(*int64)(nil), DNSPolicy:\"ClusterFirst\", NodeSelector:map[string]string(nil), ServiceAccountName:\"\", NodeName:\"fakeNode\", SecurityContext:(*api.PodSecurityContext)(0xc8208e5d40), ImagePullSecrets:[]api.LocalObjectReference(nil), Hostname:\"\", Subdomain:\"\"}, Status:api.PodStatus{Phase:\"\", Conditions:[]api.PodCondition(nil), Message:\"\", Reason:\"\", HostIP:\"\", PodIP:\"\", StartTime:(*unversioned.Time)(nil), InitContainerStatuses:[]api.ContainerStatus(nil), ContainerStatuses:[]api.ContainerStatus(nil)}}\r\n```\r\n\r\nCan you please take a look? [I'm removing lgtm for now.]"}}
{"actor":{"display_login":"wojtek-t"}}