Open
Description
Describe the bug
According to
an object parameter should, much like the
file
type parameter, be able to betaken from a file directly when specified using the
--param
option in e.g.porter install
.
To Reproduce
Steps to reproduce the behavior:
-
Use this porter.yaml:
schemaType: Bundle schemaVersion: 1.0.1 name: porter-repro version: 0.1.0 description: "An example Porter configuration" registry: "localhost:5000" # Declare and optionally configure the mixins used by the bundle mixins: - exec parameters: - name: object_parameter type: object path: /cnab/app/object_parameter.json # Define the steps that should execute when the bundle is installed install: - exec: description: "Install Hello World" command: echo arguments: - install ${ bundle.parameters.object_parameter } # Define the steps that should execute when the bundle is upgraded upgrade: - exec: description: "World 2.0" command: ./helpers.sh arguments: - upgrade # Define the steps that should execute when the bundle is uninstalled uninstall: - exec: description: "Uninstall Hello World" command: ./helpers.sh arguments: - uninstall
-
Put the following in
object_parameter.json
:{ "key": "value" }
-
Run
porter install --param object_parameter=./object_parameter.json
-
Observe the error:
unable to convert parameter's object_parameter value ./object_parameter.json to the destination parameter type object: could not unmarshal value ./object_parameter.json into a json object: invalid character '.' looking for beginning of value
Expected behavior
The file should be read and marshalled into the object parameter
representation if the parameter given in the --param
option is pointing to a
file.
Version
porter v1.2.0 (45c17c15)