File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -149,12 +149,11 @@ definitions:
149
149
maximum : 32
150
150
151
151
# A kubernetes memory declaration.
152
- # Here we only accept between 1 and 4 numbers
153
- # and force a restricted suffix (Mi or Gi)
152
+ # Here we allow a 4-digit Mi value (minimum of 4Mi)
153
+ # or a 2-digit Gi value (minimum of 1G).
154
154
memory :
155
155
type : string
156
- minLength : 1
157
- pattern : ' ^[1-9][0-9]{0,3}(Gi|Mi)$'
156
+ pattern : ' ^(([4-9]|[1-9][0-9]{1,3})Mi|[1-9][0-9]{0,1}Gi)$'
158
157
159
158
# Image environment definitions.
160
159
environment :
Original file line number Diff line number Diff line change @@ -98,11 +98,11 @@ def test_validate_image_memory_32gi():
98
98
assert error is None
99
99
100
100
101
- def test_validate_image_memory_500Mi ():
101
+ def test_validate_image_memory_4mi ():
102
102
# Arrange
103
103
text : Dict [str , Any ] = deepcopy (_MINIMAL )
104
104
demo_job : Dict [str , Any ] = text ['jobs' ]['demo' ]
105
- demo_job ['image' ]['memory' ] = '500Mi '
105
+ demo_job ['image' ]['memory' ] = '4Mi '
106
106
107
107
# Act
108
108
error = decoder .validate_job_schema (text )
You can’t perform that action at this time.
0 commit comments