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

tk env list doesn't work with tla function #653

Open
zephyros-dev opened this issue Dec 3, 2021 · 7 comments
Open

tk env list doesn't work with tla function #653

zephyros-dev opened this issue Dec 3, 2021 · 7 comments
Labels
kind/bug Something isn't working

Comments

@zephyros-dev
Copy link

zephyros-dev commented Dec 3, 2021

I have a jsonnet file like this

// environments/example/non-tla
local data = {
  namespace: {
    apiVersion: 'v1',
    kind: 'Namespace',
    metadata: {
      name: 'namespace',
    },
  },
};
local tanka = import 'github.com/grafana/jsonnet-libs/tanka-util/main.libsonnet';
{
  env: tanka.environment.new(
         name='namespace',
         namespace='namespace',
         apiserver='https://localhost:6443',
       )
       + tanka.environment.withData(data),
}

When I use tk env list with the above jsonnet file, it shows the environment normally

# tk env list environments/example/non-tla/
NAME         NAMESPACE    SERVER                    
namespace    namespace    https://localhost:6443    

But when I tried the same with a tla function, tk env list doesn't shows the environment anymore

// environments/example/tla
local data = {
  namespace: {
    apiVersion: 'v1',
    kind: 'Namespace',
    metadata: {
      name: 'namespace',
    },
  },
};
local tanka = import 'github.com/grafana/jsonnet-libs/tanka-util/main.libsonnet';
function(var='var') {
  env: tanka.environment.new(
         name='namespace',
         namespace='namespace',
         apiserver='https://localhost:6443',
       )
       + tanka.environment.withData(data),
}
# tk env list environments/example/tla/
NAME         NAMESPACE    SERVER

Both are valid jsonnet file and both render to the exact same result when I tried tk eval and tk show

@zephyros-dev zephyros-dev changed the title tk env list doesn't work with tla function tk env list doesn't work with tla function Dec 3, 2021
@stale
Copy link

stale bot commented Jan 9, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 9, 2022
@zephyros-dev
Copy link
Author

Not stale

@stale stale bot removed the stale label Jan 10, 2022
@stale
Copy link

stale bot commented Mar 2, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 2, 2022
@zephyros-dev
Copy link
Author

Not stale

@stale stale bot removed the stale label Mar 2, 2022
@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 16, 2022
@zephyros-dev
Copy link
Author

Not stale

@stale stale bot removed the stale label Apr 17, 2022
@Elfo404 Elfo404 added this to Tanka May 27, 2024
@github-project-automation github-project-automation bot moved this to Triage in Tanka May 27, 2024
@zerok zerok moved this from Triage to Backlog in Tanka May 28, 2024
@zerok zerok added the kind/bug Something isn't working label May 28, 2024
@zerok
Copy link
Contributor

zerok commented May 28, 2024

Can still reproduce this with a simple inline environment that is built via function. show is able to generate the output but env list does not list the environment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

2 participants