hashicorp / hashicorp/consul-template
Sprig_fail not correct work
- Dominant language
- Go
- Stars
- 4.8k
- Forks
- 801
- Avg merge
- 4h 5m
- Merged PRs (30d)
- 6
Description
Examples:
```go
{{ if eq (len nodes) 0 }}
{{ sprig_fail "ERROR" }}
{{ end }}
Result:
execute: template: :35:9: executing "" at : error calling sprig_fail: Error
{{ $test := nodes }}
{{ if $test }}
{{ sprig_fail }}
{{ end }}
Result:
execute: template: :35:9: executing "" at : error calling sprig_fail: Error
{{ $test := nodes }}
{{ if not $test }}
{{ sprig_fail }}
{{ end }}
Result:
execute: template: :35:9: executing "" at : error calling sprig_fail: Error
```
Unexpected behavior.
If any information is needed, I am ready to provide it.
consul-template v0.41.1 (80a4e25)
Contributor guide
Research direction
Start by reproducing the three template examples using consul-template v0.41.1 and compare the reported results. Locate the sprig_fail implementation and its existing tests, then clarify the expected behavior for each conditional case before adding a regression test and verifying the corrected error handling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100