Skip to content

Strange behavior when used with some nomad interpolation calling filesystem function #207

@nlko

Description

@nlko

Hello,

I'm not fluent at all in go and go template and the worst of all I'm quite new to nomad but I found the following behavior strange.

I have a .nomad.tpl file for nomad pack with the following:

job "hello_pack" {
  … 
  group "app" {
    …
    task "server" {
      driver = "docker"
      …
      config {
        …
        volumes = ["${abspath(".")}/packs/hello_pack:/app"]
      }
    }
  }
}

The aim is to mount a relative folder. (I took my inspiration from there hashicorp/nomad#9369 (comment))

Result:

  • nomad-pack complains when I try to do a nomad-pack run
! Failed To Parse Job Specification

	Error:   input.hcl:122,23-31: Error in function call; Call to function "abspath" failed: filesystem function disabled., and 1 other diagnostic(s)

  • but when I render the final hcl file with nomad-pack render, the result is valid for nomad and so, the rendered job can be run with the nomad job run command.

The behavior seems odd to me (why in one case it's allowed and disallowed in the other?). I would expect the same result (both running).

Version numbers:

  • Nomad v1.2.6 (a6c6b475db5073e33885377b4a5c733e1161020c)
  • Nomad Pack v0.0.1-techpreview3 (568ac5e)

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