kelseyhightower / confd

Manage local application configuration files using templates and data from etcd or consul
MIT License
8.36k stars 1.41k forks source link

FATAL empty src template #853

Closed thisXYH closed 2 years ago

thisXYH commented 2 years ago

confd v0.16

log:

2021-12-09T09:59:55+08:00 confd[618239]: INFO Backend set to etcd 2021-12-09T09:59:55+08:00 confd[618239]: INFO Starting confd 2021-12-09T09:59:55+08:00 confd[618239]: INFO Backend source(s) set to .....something..... 2021-12-09T09:59:55+08:00 confd[618239]: DEBUG Loading template resources from confdir /data/confd 2021-12-09T09:59:55+08:00 confd[618239]: DEBUG Found template: /data/confd/conf.d/confd.toml 2021-12-09T09:59:55+08:00 confd[618239]: DEBUG Loading template resource from /data/confd/conf.d/confd.toml 2021-12-09T09:59:55+08:00 confd[618239]: DEBUG Found template: /data/confd/conf.d/nginx.toml 2021-12-09T09:59:55+08:00 confd[618239]: DEBUG Loading template resource from /data/confd/conf.d/nginx.toml 2021-12-09T09:59:55+08:00 confd[618239]: FATAL empty src template

nginx.toml content

[template] src = "c.tmpl" ... ...

summary

I saw this error being thrown on the confd/resource/template/resource.go 106 ,Why this content cannot be decode?

thisXYH commented 2 years ago

I used the same struct to write a small demo, it is possible to read the value of src.