valohai / valohai-utils

Python helper library for Valohai
MIT License
2 stars 2 forks source link

Make inputs optional if the defaults are set empty #59

Closed JuhaKiili closed 3 years ago

JuhaKiili commented 3 years ago

Users want to define optional inputs with valohai-utils, but currently, it is not supported.

You define an input with valohai-utils like this:

default_inputs = {
  "my_input": "https://herpderp.com/lol.txt"
}

Generated YAML:

- name: my_input
  default:
  - https://herpderp.com/lol.txt
  optional: false

This PR introduces support for optional inputs. Just leave the value empty:

default_inputs = {
  "my_input": ""
}

Generated YAML:

- name: my_input
  optional: true