Skip to content

Support for mixins with Jsonnet external-variables #36

Open
@ArthurSens

Description

@ArthurSens

It is possible to generate mixins using jsonnet external variables, but not possible to use mixtool with those jsonnet files:

gitpod /workspace/observability $ mixtool lint monitoring-satellite/main.jsonnet 
RUNTIME ERROR: Undefined external variable: remote_write_url
        monitoring-satellite/main.jsonnet:11:7-37       builtin function <extVar>
        monitoring-satellite/main.jsonnet:89:57-59
        <std>:1293:24-25        thunk from <function <anonymous>>
        <std>:1293:5-33 function <anonymous>
        monitoring-satellite/main.jsonnet:89:40-77      $

        2:16-58 thunk <mixin> from <$>
        4:21-26 thunk from <$>
        <std>:1302:21-22        thunk from <function <anonymous>>
        <std>:1302:5-32 function <anonymous>
        4:4-47  $
        During evaluation

RUNTIME ERROR: Undefined external variable: remote_write_url
        monitoring-satellite/main.jsonnet:11:7-37       builtin function <extVar>
        monitoring-satellite/main.jsonnet:89:57-59
        <std>:1293:24-25        thunk from <function <anonymous>>
        <std>:1293:5-33 function <anonymous>
        monitoring-satellite/main.jsonnet:89:40-77      $

        2:16-58 thunk <mixin> from <$>
        4:21-26 thunk from <$>
        <std>:1302:21-22        thunk from <function <anonymous>>
        <std>:1302:5-32 function <anonymous>
        4:4-48  $
        During evaluation

2021/05/12 18:58:19 failed to lint the file monitoring-satellite/main.jsonnet: 2 lint errors found

It would be nice if we could run for example:

mixtool lint --ext-str remote_write_url='my-remote-backend-url' monitoring-satellite/main.jsonnet 

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