Adds support for `options` in inputs
What does this MR do and why?
Adds support for options
in inputs.
Changelog: added
Screenshots or screen recordings
With the following spec: inputs
spec:
inputs:
environment:
default: staging
options: [staging, test, production]
With the default value of staging
:
With a value selected from options:
ERRORS
When trying to define a default
that is not in the options
array:
spec:
inputs:
environment:
default: kitten
options: [staging, test, production]
Wjemn trying to utilize a default that is not in the options:
When trying to utilize a value that is not in the predefined options
array:
How to set up and validate locally
In a project marked as a catalog resource, add the following spec: inputs
spec:
inputs:
environment:
default: staging
options: [staging, test, production]
---
inputs_job:
script: echo "$[[inputs.environment]]"
There should be four use cases tested here, as shown in the screenshots above.
- Default value -
environment:
- Options value -
environment: anyvaluefromarray
- Error 1 - try to use another value that is not in the array for a default value
default: kitten
- Error 2 - try to use a value that is not in the array
environment: not-in-array
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Resolves: #393401 (closed)
Edited by Laura Montemayor