-
Notifications
You must be signed in to change notification settings - Fork 34
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
NEW FEATURE: variables in number fields #100
Conversation
@kerolasa @lianapanatau-ionos @wdbaker-godaddy please take look here as well if this update makes sense to you |
Signed-off-by: Sami Kerola <[email protected]>
Just to be explicit the string-number-variables can be expressed in template three different ways, and these need to be equal (assuming variable expansion results to same numeric value).
After a template is processed the value MUST to be numeric. I think that's right, right? |
@kerolasa correct. Is there any edit to the text needed to make it clear? |
The Int or string representation of Int is probably good enough. I will try to make dc-template-linter to work with int-string-variables sometime soon(ish). |
After this change numbers are always quoted after reformatting. That is the only way to be somewhat consistent what is the representation format when %variables% need to be supported, and they need to be strings. As a practical example, one could have the following in a template (and it would fail, but it's obvious why - see the hostname). "records": [ { "type": "A", "host": "the-ttl-is-plain-number-this-is-ok", "ttl": 1800 }, { "type": "A", "host": "the-ttl-is-quoted-number-this-is-ok", "ttl": "8100" }, { "type": "A", "host": "the-ttl-is-variable-this-is-ok", "ttl": "%varttl%" }, { "type": "A", "host": "ttl-is-BROKEN-it-cannot-be-just-a-string", "ttl": "just-a-string" } ] Reference: Domain-Connect/spec#100 Signed-off-by: Sami Kerola <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When this is merged I need to merge the dc-template-linter change to sync the tooling with the spec.
After this change numbers are always quoted after reformatting. That is the only way to be somewhat consistent what is the representation format when %variables% need to be supported, and they need to be strings. As a practical example, one could have the following in a template (and it would fail, but it's obvious why - see the hostname). "records": [ { "type": "A", "host": "the-ttl-is-plain-number-this-is-ok", "ttl": 1800 }, { "type": "A", "host": "the-ttl-is-quoted-number-this-is-ok", "ttl": "8100" }, { "type": "A", "host": "the-ttl-is-variable-this-is-ok", "ttl": "%varttl%" }, { "type": "A", "host": "ttl-is-BROKEN-it-cannot-be-just-a-string", "ttl": "just-a-string" } ] Reference: Domain-Connect/spec#100 Signed-off-by: Sami Kerola <[email protected]>
I have reviewed with DEV and they will approve the pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved based on JK comment
This change is now under community vote: https://domainconnect.slack.com/archives/CBTKX8R4G/p1736188710187489 |
Adresses issue #88