File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,7 @@ definitions:
154
154
value-from :
155
155
oneOf :
156
156
- $ref : ' #/definitions/environment-value-from-api-token'
157
+ - $ref : ' #/definitions/environment-value-from-constant'
157
158
- $ref : ' #/definitions/environment-value-from-secret'
158
159
required :
159
160
- name
@@ -182,6 +183,22 @@ definitions:
182
183
required :
183
184
- api-token
184
185
186
+ # An Image environment from a constant.
187
+ environment-value-from-constant :
188
+ type : object
189
+ additionalProperties : false
190
+ properties :
191
+ constant :
192
+ type : object
193
+ properties :
194
+ # The hard-coded value (constant)
195
+ value :
196
+ type : string
197
+ required :
198
+ - value
199
+ required :
200
+ - constant
201
+
185
202
# An Image environment from a Kubernetes 'secret'.
186
203
# At the moment we expect the secret to be unencrypted,
187
204
# just 'opaque', so it can be read by the DM without special actions.
Original file line number Diff line number Diff line change @@ -50,6 +50,23 @@ def test_validate_image_env_from_api_token():
50
50
assert error is None
51
51
52
52
53
+ def test_validate_image_env_from_constant ():
54
+ # Arrange
55
+ text : Dict [str , Any ] = deepcopy (_MINIMAL )
56
+ demo_job : Dict [str , Any ] = text ['jobs' ]['demo' ]
57
+ demo_job ['image' ]['environment' ] = \
58
+ [{'name' : 'ENV_VAR' ,
59
+ 'value-from' : {
60
+ 'constant' : {
61
+ 'value' : '123' }}}]
62
+
63
+ # Act
64
+ error = decoder .validate_job_schema (text )
65
+
66
+ # Assert
67
+ assert error is None
68
+
69
+
53
70
def test_validate_image_env_from_secret ():
54
71
# Arrange
55
72
text : Dict [str , Any ] = deepcopy (_MINIMAL )
You can’t perform that action at this time.
0 commit comments