Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return empty array for GetAll intead of err #1

Closed
wants to merge 1 commit into from
Closed

return empty array for GetAll intead of err #1

wants to merge 1 commit into from

Conversation

johnrengelman
Copy link

Support template processing where a key may not be available at templating time (i.e. no passing servers for a Consul service health check)

kelseyhightower/confd#102

@kelseyhightower
Copy link
Owner

@johnrengelman This will break things as we want to ensure if no match is found we return an error. Is the idea being we want an empty list in some cases?

@johnrengelman
Copy link
Author

Yes. For example, you have a template for HAProxy that relies on Consul returning the healthy hosts for a service. If there are none, then Consul returns an empty list which would cause an error in confd when the template is processed. But this isn't really an error condition as having no backend servers is a valid state for HAProxy.

@johnrengelman
Copy link
Author

Perhaps a new function that doesn't error? GetList?

@okushchenko
Copy link
Collaborator

Fixed in 32a4556

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants