Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(env list): allow specifying a jsonnet implementation #1208

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

julienduchesne
Copy link
Member

This will allow us to run this with jrsonnet, making it way faster

This will allow us to run this with `jrsonnet`, making it way faster
@julienduchesne julienduchesne requested a review from a team as a code owner October 22, 2024 16:37
@julienduchesne julienduchesne changed the title env list: Allow specifying a jsonnet implementation feat: env list: Allow specifying a jsonnet implementation Oct 22, 2024
@zerok zerok changed the title feat: env list: Allow specifying a jsonnet implementation feat(env list): allow specifying a jsonnet implementation Oct 23, 2024
@julienduchesne julienduchesne added this pull request to the merge queue Oct 23, 2024
Merged via the queue into main with commit a3e7140 Oct 23, 2024
13 of 14 checks passed
@julienduchesne julienduchesne deleted the julienduchesne/env-list-jrsonnet branch October 23, 2024 12:00
@fsgh42
Copy link

fsgh42 commented Oct 27, 2024

@julienduchesne nice job, I was waiting for this!

Sadly, currently this seems incompatible with tanka.helm:

$ tk eval --jsonnet-implementation 'binary:/usr/bin/jrsonnet' environments/prod/main.jsonnet 
Error: evaluating jsonnet: error running file redacted/tanka/environments/prod/main.jsonnet: exit status 1
only functions can be called, got null
    vendor/github.com/grafana/jsonnet-libs/tanka-util/helm.libsonnet:48:21-31:   variable <chartData> access
    vendor/github.com/grafana/jsonnet-libs/tanka-util/k8s.libsonnet:43:7-14:     variable <object> access
    vendor/github.com/grafana/jsonnet-libs/tanka-util/k8s.libsonnet:13:21-28:    variable <object> access
    argument <v> evaluation
    vendor/github.com/grafana/jsonnet-libs/tanka-util/k8s.libsonnet:13:8-29:     function <builtin_is_object> call
    vendor/github.com/grafana/jsonnet-libs/tanka-util/k8s.libsonnet:13:16-13:17: if condition
    vendor/github.com/grafana/jsonnet-libs/tanka-util/k8s.libsonnet:42:6-42:7:   function <patchKubernetesObjects> call
    vendor/github.com/grafana/jsonnet-libs/tanka-util/helm.libsonnet:48:5-52:    function <patchLabels> call
    lib/redacted/argocd.libsonnet:75:6-75:7:                                         function <template> call
    field <argocd> manifestification

I cannot get this to render by passing just ./vendor and ./lib folders to the native jsonnet binary either.
Since tk eval works perfectly fine on the same code I suspect there might be additional magic hidden somewhere in tanka one might need to pass to external binary invocation as well.

@julienduchesne
Copy link
Member Author

Yup, no native functions. Hide any attribute that isn't a Tanka env

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants