{"action":"created","issue":{"url":"https://api.github.com/repos/fabric8io/spring-cloud-kubernetes/issues/56","repository_url":"https://api.github.com/repos/fabric8io/spring-cloud-kubernetes","labels_url":"https://api.github.com/repos/fabric8io/spring-cloud-kubernetes/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/fabric8io/spring-cloud-kubernetes/issues/56/comments","events_url":"https://api.github.com/repos/fabric8io/spring-cloud-kubernetes/issues/56/events","html_url":"https://github.com/fabric8io/spring-cloud-kubernetes/issues/56","id":173814933,"number":56,"title":"Can't get a value from ConfigMap ","user":{"login":"lburgazzoli","id":1868933,"avatar_url":"https://avatars.githubusercontent.com/u/1868933?v=3","gravatar_id":"","url":"https://api.github.com/users/lburgazzoli","html_url":"https://github.com/lburgazzoli","followers_url":"https://api.github.com/users/lburgazzoli/followers","following_url":"https://api.github.com/users/lburgazzoli/following{/other_user}","gists_url":"https://api.github.com/users/lburgazzoli/gists{/gist_id}","starred_url":"https://api.github.com/users/lburgazzoli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lburgazzoli/subscriptions","organizations_url":"https://api.github.com/users/lburgazzoli/orgs","repos_url":"https://api.github.com/users/lburgazzoli/repos","events_url":"https://api.github.com/users/lburgazzoli/events{/privacy}","received_events_url":"https://api.github.com/users/lburgazzoli/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-29T16:27:56Z","updated_at":"2016-08-29T18:59:30Z","closed_at":null,"body":"I have a very simple sample that should retrieve a value from a ConfigMap but I can't get it working.\r\n\r\nCode, pom and logs are on this gist: https://gist.github.com/lburgazzoli/c8cb1db8f57eeaeca57d8d5b53d61b1e\r\n\r\nIf I replace the home method with a direct call to a KubernetesClient, I'm able to get the desired value from the config map :\r\n\r\n```java\r\n@RestController\r\n@SpringBootApplication\r\npublic class MyApplication {\r\n    private static final Logger LOGGER = LoggerFactory.getLogger(MyApplication.class);\r\n\r\n    @Autowired\r\n    public KubernetesClient client;\r\n\r\n    @RequestMapping(\"/\")\r\n    String home() {\r\n        return client.configMaps().withName(\"demo\").get().getData().get(\"mydata\");\r\n    }\r\n\r\n    public static void main(String[] args) throws Exception {\r\n        SpringApplication.run(MyApplication.class, args);\r\n    }\r\n}\r\n```\r\n\r\nIt looks like the ConfigMap PropertySource is not taken into account.\r\n"},"comment":{"url":"https://api.github.com/repos/fabric8io/spring-cloud-kubernetes/issues/comments/243220839","html_url":"https://github.com/fabric8io/spring-cloud-kubernetes/issues/56#issuecomment-243220839","issue_url":"https://api.github.com/repos/fabric8io/spring-cloud-kubernetes/issues/56","id":243220839,"user":{"login":"christian-posta","id":53201,"avatar_url":"https://avatars.githubusercontent.com/u/53201?v=3","gravatar_id":"","url":"https://api.github.com/users/christian-posta","html_url":"https://github.com/christian-posta","followers_url":"https://api.github.com/users/christian-posta/followers","following_url":"https://api.github.com/users/christian-posta/following{/other_user}","gists_url":"https://api.github.com/users/christian-posta/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-posta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-posta/subscriptions","organizations_url":"https://api.github.com/users/christian-posta/orgs","repos_url":"https://api.github.com/users/christian-posta/repos","events_url":"https://api.github.com/users/christian-posta/events{/privacy}","received_events_url":"https://api.github.com/users/christian-posta/received_events","type":"User","site_admin":false},"created_at":"2016-08-29T18:59:30Z","updated_at":"2016-08-29T18:59:30Z","body":"@lburgazzoli Are you on OpenShift by chance? Or vanilla Kubernetes? so by default only the `default` service account is attached to a pod. this service account may not have privileges to read from the kubernetes API. \r\n\r\nIf on open shift `oadm policy add-role-to-user <role> <username>`\r\n\r\nsee here https://docs.openshift.com/enterprise/3.2/admin_guide/manage_authorization_policy.html#viewing-cluster-policy\r\n\r\ntry adding 'edit' role to see if it works; then we can back it down from there"}}
{"actor":{"display_login":"christian-posta"}}