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

Dinamic variables and envs #866

Open
legolego621 opened this issue Jan 17, 2024 · 3 comments
Open

Dinamic variables and envs #866

legolego621 opened this issue Jan 17, 2024 · 3 comments
Labels

Comments

@legolego621
Copy link

Hello, can I use dinamic variables and envs like this?

command:
  kubectl get nodes:
    exit-status: 0
    stdout:
      not:
        match-regexp: 'NotReady'
  export test="a":
    exit-status: 0



http:
  '{{.Env.test}}':
    status: 200
    timeout: 5000
@aelsabbahy
Copy link
Member

Using a command output as a variable isn't supported currently. You would have to generate the vars.yaml file prior to running Goss.

This isn't a bad feature request, it's somewhat related to #784

If the vars.yaml supported a simple interface that ran a command to set the car to its stdout.. would that sufficiently solve #784 or does it add too much complexity?

@aelsabbahy
Copy link
Member

Cc: @uk-bolly (meant to tag you on last comment)

@uk-bolly
Copy link

uk-bolly commented Mar 1, 2024

thanks @aelsabbahy @legolego621

I like the idea and does cover off some of the idea of #784

However i would be using some some discovered variables multiple times, so it would require a running order, alternatively a wrapper script to set all the variables that could be inherited, if that would work?
The simplicity of goss and modules would be lost somewhat with a wrapper script at that level.

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

No branches or pull requests

3 participants