Skip to content
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

Make inputs optional if the defaults are set empty #59

Merged
merged 2 commits into from
Jun 22, 2021

Conversation

JuhaKiili
Copy link
Contributor

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

@JuhaKiili JuhaKiili requested a review from tokkoro June 21, 2021 12:46
@JuhaKiili JuhaKiili requested a review from tokkoro June 22, 2021 08:10
Copy link
Contributor

@tokkoro tokkoro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@JuhaKiili JuhaKiili merged commit dd62fa1 into master Jun 22, 2021
@JuhaKiili JuhaKiili deleted the optional-inputs branch June 22, 2021 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants