porter icon indicating copy to clipboard operation
porter copied to clipboard

Can't default a file parameter with a filepath

Open carolynvs opened this issue 4 years ago • 0 comments

Describe the bug

This is a gap in our implementation of the custom file parameter type. The underlying type is actually a base64 encoded string. Currently that is accidentally leaked to the user by default which doesn't accept a filepath, only "" or a base64 encoded string.

To Reproduce

  1. Create a bundle with a file type parameter
  2. Make the parameter optional by specifying a default
  3. Try to run the bundle and you get an error.
parameters:
- name: myparam
  type: file
  default: defaultParam.txt # located in the bundle at defaultParam.txt, next to the porter.yaml file

Expected behavior

The default value should be read from filepath specified (which refers to a location relative to porter.yaml) and embed the base64 encoded value in the bundle definition.

Porter Command and Output

$ porter install

Error: unable to decode parameter publicIP: illegal base64 data at input byte 63
Error: 1 error occurred:
	* container exit code: 1, message: <nil>

Version

v0.30.1

carolynvs avatar Dec 15 '20 14:12 carolynvs