{"action":"created","issue":{"url":"https://api.github.com/repos/kelseyhightower/confd/issues/704","repository_url":"https://api.github.com/repos/kelseyhightower/confd","labels_url":"https://api.github.com/repos/kelseyhightower/confd/issues/704/labels{/name}","comments_url":"https://api.github.com/repos/kelseyhightower/confd/issues/704/comments","events_url":"https://api.github.com/repos/kelseyhightower/confd/issues/704/events","html_url":"https://github.com/kelseyhightower/confd/issues/704","id":318289113,"number":704,"title":"Does the \"keys\" really work?","user":{"login":"ozbillwang","id":8954908,"avatar_url":"https://avatars3.githubusercontent.com/u/8954908?v=4","gravatar_id":"","url":"https://api.github.com/users/ozbillwang","html_url":"https://github.com/ozbillwang","followers_url":"https://api.github.com/users/ozbillwang/followers","following_url":"https://api.github.com/users/ozbillwang/following{/other_user}","gists_url":"https://api.github.com/users/ozbillwang/gists{/gist_id}","starred_url":"https://api.github.com/users/ozbillwang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ozbillwang/subscriptions","organizations_url":"https://api.github.com/users/ozbillwang/orgs","repos_url":"https://api.github.com/users/ozbillwang/repos","events_url":"https://api.github.com/users/ozbillwang/events{/privacy}","received_events_url":"https://api.github.com/users/ozbillwang/received_events","type":"User","site_admin":false},"labels":[{"id":58843395,"url":"https://api.github.com/repos/kelseyhightower/confd/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-04-27T06:12:47Z","updated_at":"2018-05-02T08:53:15Z","closed_at":null,"author_association":"NONE","body":"Read the [quick start guide](https://github.com/kelseyhightower/confd/blob/master/docs/quick-start-guide.md#create-a-template-resource-config) to create a template resource config file as below.\r\n\r\n\r\n```\r\n$ cat /etc/confd/conf.d/myconfig.toml\r\n...\r\nkeys = [\r\n    \"/myapp/database/url\",\r\n    \"/myapp/database/user\",\r\n]\r\n...\r\n$ cat /etc/confd/templates/myconfig.conf.tmpl\r\n\r\n[myconfig]\r\ndatabase_url = {{getv \"/myapp/database/url\"}}\r\ndatabase_user = {{getv \"/myapp/database/user\"}}\r\n```\r\n\r\nAs my understanding is, confd will replace with real secrets for all keys list in `/etc/confd/conf.d/myconfig.toml` . But in fact, it still overrides all keys.\r\n\r\nIf I remove one key from /etc/confd/conf.d/myconfig.toml, \r\n\r\n```\r\n$ cat /etc/confd/conf.d/myconfig.toml\r\n...\r\nkeys = [\r\n    \"/myapp/database/user\",\r\n]\r\n...\r\n```\r\nthe output file should only be replaced by one key `/myapp/database/user`. But I found all confd key `{{ getv ....}}` are replaced with secrets."},"comment":{"url":"https://api.github.com/repos/kelseyhightower/confd/issues/comments/385909092","html_url":"https://github.com/kelseyhightower/confd/issues/704#issuecomment-385909092","issue_url":"https://api.github.com/repos/kelseyhightower/confd/issues/704","id":385909092,"user":{"login":"okushchenko","id":8613413,"avatar_url":"https://avatars3.githubusercontent.com/u/8613413?v=4","gravatar_id":"","url":"https://api.github.com/users/okushchenko","html_url":"https://github.com/okushchenko","followers_url":"https://api.github.com/users/okushchenko/followers","following_url":"https://api.github.com/users/okushchenko/following{/other_user}","gists_url":"https://api.github.com/users/okushchenko/gists{/gist_id}","starred_url":"https://api.github.com/users/okushchenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okushchenko/subscriptions","organizations_url":"https://api.github.com/users/okushchenko/orgs","repos_url":"https://api.github.com/users/okushchenko/repos","events_url":"https://api.github.com/users/okushchenko/events{/privacy}","received_events_url":"https://api.github.com/users/okushchenko/received_events","type":"User","site_admin":false},"created_at":"2018-05-02T08:53:15Z","updated_at":"2018-05-02T08:53:15Z","author_association":"COLLABORATOR","body":"@ozbillwang I suggest you to use a different prefix for different environments, then use the `-prefix` option of confd to get only the keys that are relevant for the given environment. Environment value can be injected from the environment variables like that `-prefix /myapp/database/$ENVIRONMENT`. You can then reference the keys in confd without the prefix part, which is very convenient.\r\nAlso, I suggest you to prefix all of the keys with the `/$SERVICE/$ENVIRONMENT` string (SERVICE=myapp ENVIRONMENT=staging), which then can be used as a prefix in confd."}}
{"actor":{"display_login":"okushchenko"}}