-
Notifications
You must be signed in to change notification settings - Fork 197
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
Can't pass source variables to the exec arguments list #158
Comments
just for information, I got the exact same issue by running with porter only: porter run --action install --file ./porter.yaml --debug really looking forward to this fix :) |
This turns out not to be a problem with the way the parameter sourcing is working exactly..., it's a "how go is parsing YAML and reflection" problem. You can pass the params, with slightly different YAML right now. The yaml above fails (here it is again):
However.....this does work
When the YAML blob gets loaded to process, it's failing to handle that correctly. Working on a fix now. |
I think I know what you are running into! Short answer: Set an environment variable named after the parameter that you are trying to access (or matching the destination env var used) before running Long answer: porter is intended to execute inside of a CNAB environment. From the spec, parameters are either exported as environment variables in the environment or as files (depending on how they are defined in the bundle). Porter reads parameters and credentials not from the porter.yaml but from the CNAB environment. That's why you saw in my examples that I was running a |
…put sourcing This PR updates how we handle slice elements for doing parameter/credential/ouput sourcing. We probably should think about revisitng the entire process for this in the future. In summary, we are using reflectwalk to handle walking the manifest. This involves handling a couple call backs, notably "SliceElement" and "MapElement". The Slice Element assumed that it would see something of the form source: <x.y.z> as a string. In reality, if that's not wrapped in quote, Go and YAML see that as a Map, but the map callback doesn't get called to handle that. This was resulting in the block not getting rewritten and the exec mixin was exploding (probably any would have). This PR updates the logic of the slice elem processing to check and see if it's a map and handle it in a similar manner to a top level map entry in the yaml. Closes: getporter#158
…put sourcing This PR updates how we handle slice elements for doing parameter/credential/ouput sourcing. We probably should think about revisitng the entire process for this in the future. In summary, we are using reflectwalk to handle walking the manifest. This involves handling a couple call backs, notably "SliceElement" and "MapElement". The Slice Element assumed that it would see something of the form source: <x.y.z> as a string. In reality, if that's not wrapped in quote, Go and YAML see that as a Map, but the map callback doesn't get called to handle that. This was resulting in the block not getting rewritten and the exec mixin was exploding (probably any would have). This PR updates the logic of the slice elem processing to check and see if it's a map and handle it in a similar manner to a top level map entry in the yaml. Closes: getporter#158
This was first implemented in #31 but doesn't seem to work anymore.
When you run this, replace TODO with your username.
The text was updated successfully, but these errors were encountered: