Skip to content

Sprig_fail not correct work #2080

@dpmorozov

Description

@dpmorozov

Examples:

{{ if eq (len nodes) 0 }}
{{ sprig_fail "ERROR" }}
{{ end }}

Result:
execute: template: :35:9: executing "" at <sprig_fail "Error">: error calling sprig_fail: Error

{{ $test := nodes }}
{{ if $test }}
  {{ sprig_fail }}
{{ end }}

Result:
execute: template: :35:9: executing "" at <sprig_fail "Error">: error calling sprig_fail: Error

{{ $test := nodes }}
{{ if not $test }}
  {{ sprig_fail }}
{{ end }}

Result:
execute: template: :35:9: executing "" at <sprig_fail "Error">: error calling sprig_fail: Error

Unexpected behavior.

If any information is needed, I am ready to provide it.

consul-template v0.41.1 (80a4e25)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions