Skip to content
This repository was archived by the owner on Jun 27, 2025. It is now read-only.
This repository was archived by the owner on Jun 27, 2025. It is now read-only.

Problem with multiservice task  #455

@perrfect

Description

@perrfect

Hello.
I use Levant v0.3.1 and test multiservice task via var-file.

My var-file for multiservice task looks like:

"tasks": [
      {
        "first_task_name": {
          "config": {
            "image": "test"
          },
          "resources": {
            "cpu": 100,
            "memory": 256
          }
        },
        "second_task_name": {
          "config": {
            "image": "test"
          },
          "resources": {
            "cpu": 100,
            "memory": 256
          }
        }
      }
    ]

job.nomad looks like:

    task "[[ .job.tasks ]]" {
      driver = "docker"

      resources {
        cpu = [[ .job.tasks.resources.cpu ]]
        memory = [[ .job.tasks.resources.memory ]]
      }

And I run my job.nomad file:

levant plan -log-level=debug -var-file=vars.json -address='${env.NOMAD_URL}' job.nomad

But getting the error:

[ERROR] levant/command: template: jobTemplate:113:21: executing "jobTemplate" at <.job.tasks.resources.cpu>: can't evaluate field resources in type interface {}

I don't understand where is a mistake and why json doesn't parse correctly.
Please help me.
Thank you.

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