Skip to content

Undefined external variable: tanka.dev/environment #480

Closed
@smuth4

Description

This error occurs on the latest build (works just fine in 0.13.0) when I try to use any of the spec data as per https://tanka.dev/config#jsonnet-access:

Error: evaluating jsonnet: RUNTIME ERROR: Undefined external variable: tanka.dev/environment
        <internal>/tk.libsonnet:3:8-43  object <anonymous>
        /home/tanka-test/environments/default/main.jsonnet:7:13-19
        Field "test"
        During manifestation

Minimal reproducible example:
environments/default/main.jsonnet

local tk = import "tk";
{
  test: {
    apiVersion: 'v1',
    kind: 'Namespace',
    metadata: {
      name: tk.env.spec.namespace
    }
  }
}

environments/default/spec.json

{
  "apiVersion": "tanka.dev/v1alpha1",
  "kind": "Environment",
  "metadata": {
    "name": "environments/default"
  },
  "spec": {
    "apiServer": "",
    "namespace": "default",
    "resourceDefaults": {},
    "expectVersions": {}
  }
}

tk eval environments/default, also happens on any other command against it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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