{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/47797","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/47797/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/47797/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/47797/events","html_url":"https://github.com/kubernetes/kubernetes/issues/47797","id":237264174,"number":47797,"title":"NetworkPolicy with namespaceSelector on name i.s.o. custom label","user":{"login":"boeboe","id":415310,"avatar_url":"https://avatars1.githubusercontent.com/u/415310?v=3","gravatar_id":"","url":"https://api.github.com/users/boeboe","html_url":"https://github.com/boeboe","followers_url":"https://api.github.com/users/boeboe/followers","following_url":"https://api.github.com/users/boeboe/following{/other_user}","gists_url":"https://api.github.com/users/boeboe/gists{/gist_id}","starred_url":"https://api.github.com/users/boeboe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boeboe/subscriptions","organizations_url":"https://api.github.com/users/boeboe/orgs","repos_url":"https://api.github.com/users/boeboe/repos","events_url":"https://api.github.com/users/boeboe/events{/privacy}","received_events_url":"https://api.github.com/users/boeboe/received_events","type":"User","site_admin":false},"labels":[{"id":617149945,"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/needs-sig","name":"needs-sig","color":"ededed","default":false},{"id":116712108,"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/sig/network","name":"sig/network","color":"d2b48c","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-06-20T16:04:23Z","updated_at":"2017-06-20T17:08:33Z","closed_at":null,"body":" @kubernetes/sig-network\r\n\r\nI try to implement a network policy with namespaceSection based on the name of the namespace. This seems not to work however. When I add an extra custom label on that namespace and use that as selector in matchLabels, it works however.\r\n\r\nNot working NetworkPolicy:\r\n\r\n\tapiVersion: extensions/v1beta1\r\n\tkind: NetworkPolicy\r\n\tmetadata:\r\n\t  name: test-network-policy\r\n\t  namespace: default\r\n\tspec:\r\n\t  podSelector:\r\n\t\tmatchLabels:\r\n\t\t  role: db\r\n\t  ingress:\r\n\t  - from:\r\n\t\t- namespaceSelector:\r\n\t\t\tmatchLabels:\r\n\t\t\t  name: <namespace-name>\r\n\t\tports:\r\n\t\t- protocol: tcp\r\n\t\t  port: 6379\r\n\r\nWorking NetworkPolicy:\t\t  \r\n\t\t  \r\n\tapiVersion: extensions/v1beta1\r\n\tkind: NetworkPolicy\r\n\tmetadata:\r\n\t  name: test-network-policy\r\n\t  namespace: default\r\n\tspec:\r\n\t  podSelector:\r\n\t\tmatchLabels:\r\n\t\t  role: db\r\n\t  ingress:\r\n\t  - from:\r\n\t\t- namespaceSelector:\r\n\t\t\tmatchLabels:\r\n\t\t\t  <custom label on namespace>: <value>\r\n\t\tports:\r\n\t\t- protocol: tcp\r\n\t\t  port: 6379\r\n\r\nIs this intended behaviour, since I cannot get this out of the documentation?\r\nhttps://kubernetes.io/docs/concepts/services-networking/networkpolicies"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/309824987","html_url":"https://github.com/kubernetes/kubernetes/issues/47797#issuecomment-309824987","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/47797","id":309824987,"user":{"login":"xiangpengzhao","id":15881573,"avatar_url":"https://avatars3.githubusercontent.com/u/15881573?v=3","gravatar_id":"","url":"https://api.github.com/users/xiangpengzhao","html_url":"https://github.com/xiangpengzhao","followers_url":"https://api.github.com/users/xiangpengzhao/followers","following_url":"https://api.github.com/users/xiangpengzhao/following{/other_user}","gists_url":"https://api.github.com/users/xiangpengzhao/gists{/gist_id}","starred_url":"https://api.github.com/users/xiangpengzhao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiangpengzhao/subscriptions","organizations_url":"https://api.github.com/users/xiangpengzhao/orgs","repos_url":"https://api.github.com/users/xiangpengzhao/repos","events_url":"https://api.github.com/users/xiangpengzhao/events{/privacy}","received_events_url":"https://api.github.com/users/xiangpengzhao/received_events","type":"User","site_admin":false},"created_at":"2017-06-20T17:08:33Z","updated_at":"2017-06-20T17:08:33Z","body":"/sig network"}}
{"actor":{"display_login":"xiangpengzhao"}}