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

0.21.1 introduced breaking change for loop #1285

Closed
gmr opened this issue Sep 23, 2019 · 0 comments
Closed

0.21.1 introduced breaking change for loop #1285

gmr opened this issue Sep 23, 2019 · 0 comments
Labels
Milestone

Comments

@gmr
Copy link
Contributor

gmr commented Sep 23, 2019

The changes in PR #1255 appears to have broken my previously working template.

Consul Template version

0.21.1 - 0.22.0

Consul Version

1.3.0

Configuration

{{ $range_min := key "loop_min" | parseInt }}{{ $range_max := key "loop_max" | parseInt | add 1 }}{{ range offset := loop $range_min $range_max }} ... 

Expected behavior

Pulling an integer value stored in Consul's KV store and sending it through parseInt should provide a value usable by loop.

Actual behavior

What actually happened?

Upgrading from 0.21.0 to 0.22.0 broke working templates with the following errors:

 [ERR] (cli) /etc/rejected.yaml.ctmpl: execute: template: :35:404: executing “” at <loop $range_min $range_max>: error calling loop: loop: bad argument type: int64

Steps to reproduce

  1. Store a min and max value in Consul's KV store
  2. Retrieve them and set them to a variable using syntax similar to {{ $range_min := key "loop_min" | parseInt }}
  3. Use as an argument in loop

References

Are there any other GitHub issues (open or closed) that should
be linked here? For example:

@eikenb eikenb added the bug label Sep 26, 2019
@eikenb eikenb closed this as completed in d34ace1 Oct 3, 2019
@eikenb eikenb added this to the 0.22.1 milestone Oct 3, 2019
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