-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhances how we're handling slice processing for param/credential/out…
…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: #158
- Loading branch information
1 parent
4d5fbb8
commit f9cdd1f
Showing
3 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
mixins: | ||
- exec | ||
|
||
name: HELLO | ||
version: 0.1.0 | ||
description: "An example Porter configuration" | ||
invocationImage: jeremyrickard/porter-hello:latest | ||
|
||
parameters: | ||
- name: command | ||
type: string | ||
default: "echo Hello World" | ||
|
||
install: | ||
- description: "Install Hello World" | ||
exec: | ||
command: bash | ||
arguments: | ||
- -c | ||
- source: bundle.parameters.command | ||
|
||
|
||
uninstall: | ||
- description: "Uninstall Hello World" | ||
exec: | ||
command: bash | ||
arguments: | ||
- -c | ||
- echo Goodbye World |