Skip to content

[ Question ] Is there a way to override dependency var using -var-file ? #612

@guyteubbe

Description

@guyteubbe

Hi,

When creating a main pack which in turns uses dependencies, I would like my main pack to override the var values in these dependencies.

Context:
This main pack uses prometheus pack dependency from the community registry.

If I use the -var-file argument, with an override file in which I define prometheus_task_resources={"cpu" = 500, "memory" = 512}, it's not working:

nomad-pack render --parser-v1 -var-file="./monitoring/override.hcl" ./monitoring

The dependency variables values still apply.

My understanding, taken from the docs, is that I need to use the entire dependency object to modify the var value. Indeed, the doc says:

nomad-pack run hello_pack_with_deps --var demo_dep.message="example"

What I'm doing:

So, when using -var argument and not -var-file anymore, if I use:

nomad-pack render --parser-v1 -var 'prometheus.prometheus_task_resources={"cpu"=500,"memory"=512}' ./monitoring

It's working.

Question:

How to do the same with -var-file ?

I see there is this issue which mentions something similar. Is this a missing feature ?

Thanks

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