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

type enforcement string vs bool #112

Open
rjhornsby opened this issue Aug 17, 2021 · 0 comments
Open

type enforcement string vs bool #112

rjhornsby opened this issue Aug 17, 2021 · 0 comments
Labels

Comments

@rjhornsby
Copy link

rjhornsby commented Aug 17, 2021

Edit: maybe the behavior of consul-esm (I swear if DYAC changes that to consul-ism one more time...) is correct because this is metadata - k/v pairs which are only allowed to have string values?

--

consul proper expects boolean values where called for, ie server = true, while consul-esm appears to want strings for the same.

In the consul-esm example config:

// The node metadata values used for the ESM to qualify a node in the catalog
// as an "external node".
external_node_meta {
    "external-node" = "true"
}

The example config matches the expectations of consul-esm, and will complain if a boolean value is provided here in the above.

* 'external_node_meta[0][external-node]' expected type 'string', got unconvertible type 'bool'

While consul-esm is internally consistent, it doesn't appear to correspond with consul's type expectations.

One of the reasons I noticed this is because I'm using .erb files to generate much of consul's configuration, and had to put several comment reminders to myself not to quote the RHS of some_key = <%= some_bool_value %> because consul expects a bool, not a string, and will fail if the type is not correct.

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

No branches or pull requests

2 participants