File tree 5 files changed +18
-30
lines changed
5 files changed +18
-30
lines changed Original file line number Diff line number Diff line change @@ -181,12 +181,12 @@ type WorkloadResourceQuantity {
181
181
"""
182
182
The number of CPU cores.
183
183
"""
184
- cpu : Float !
184
+ cpu : Float
185
185
186
186
"""
187
187
The amount of memory in bytes.
188
188
"""
189
- memory : Int !
189
+ memory : Int
190
190
}
191
191
192
192
"""
Original file line number Diff line number Diff line change @@ -230,21 +230,21 @@ func (a *Application) Resources() *ApplicationResources {
230
230
if resources := a .Spec .Resources ; resources != nil {
231
231
if resources .Limits != nil {
232
232
if q , err := resource .ParseQuantity (resources .Limits .Cpu ); err == nil {
233
- ret .Limits .CPU = q .AsApproximateFloat64 ()
233
+ ret .Limits .CPU = ptr . To ( q .AsApproximateFloat64 () )
234
234
}
235
235
236
236
if m , err := resource .ParseQuantity (resources .Limits .Memory ); err == nil {
237
- ret .Limits .Memory = m .Value ()
237
+ ret .Limits .Memory = ptr . To ( m .Value () )
238
238
}
239
239
}
240
240
241
241
if resources .Requests != nil {
242
242
if q , err := resource .ParseQuantity (resources .Requests .Cpu ); err == nil {
243
- ret .Requests .CPU = q .AsApproximateFloat64 ()
243
+ ret .Requests .CPU = ptr . To ( q .AsApproximateFloat64 () )
244
244
}
245
245
246
246
if m , err := resource .ParseQuantity (resources .Requests .Memory ); err == nil {
247
- ret .Requests .Memory = m .Value ()
247
+ ret .Requests .Memory = ptr . To ( m .Value () )
248
248
}
249
249
}
250
250
Original file line number Diff line number Diff line change @@ -268,21 +268,21 @@ func (j *Job) Resources() *JobResources {
268
268
269
269
if resources .Limits != nil {
270
270
if q , err := resource .ParseQuantity (resources .Limits .Cpu ); err == nil {
271
- ret .Limits .CPU = q .AsApproximateFloat64 ()
271
+ ret .Limits .CPU = ptr . To ( q .AsApproximateFloat64 () )
272
272
}
273
273
274
274
if m , err := resource .ParseQuantity (resources .Limits .Memory ); err == nil {
275
- ret .Limits .Memory = m .Value ()
275
+ ret .Limits .Memory = ptr . To ( m .Value () )
276
276
}
277
277
}
278
278
279
279
if resources .Requests != nil {
280
280
if q , err := resource .ParseQuantity (resources .Requests .Cpu ); err == nil {
281
- ret .Requests .CPU = q .AsApproximateFloat64 ()
281
+ ret .Requests .CPU = ptr . To ( q .AsApproximateFloat64 () )
282
282
}
283
283
284
284
if m , err := resource .ParseQuantity (resources .Requests .Memory ); err == nil {
285
- ret .Requests .Memory = m .Value ()
285
+ ret .Requests .Memory = ptr . To ( m .Value () )
286
286
}
287
287
}
288
288
Original file line number Diff line number Diff line change @@ -91,8 +91,8 @@ type WorkloadResources interface {
91
91
}
92
92
93
93
type WorkloadResourceQuantity struct {
94
- CPU float64 `json:"cpu"`
95
- Memory int64 `json:"memory"`
94
+ CPU * float64 `json:"cpu"`
95
+ Memory * int64 `json:"memory"`
96
96
}
97
97
98
98
type AuthIntegration interface {
You can’t perform that action at this time.
0 commit comments