Skip to content

Commit

Permalink
Allow requests for ephemeral-storage in validation/config.go
Browse files Browse the repository at this point in the history
  • Loading branch information
jiridanek committed Dec 11, 2024
1 parent 3f0b176 commit d57b243
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/validation/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ func validateResourceList(fieldRoot string, list api.ResourceList) []error {
var numInvalid int
for key := range list {
switch key {
case "cpu", "memory", api.ShmResource, api.NvidiaGPUResource:
case "cpu", "memory", "ephemeral-storage", api.ShmResource, api.NvidiaGPUResource:
quantity, err := resource.ParseQuantity(list[key])
if err != nil {
validationErrors = append(validationErrors, fmt.Errorf("%s.%s: invalid quantity: %w", fieldRoot, key, err))
Expand Down
14 changes: 14 additions & 0 deletions pkg/validation/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,20 @@ func TestValidateResources(t *testing.T) {
},
expectedErr: true,
},
{
name: "valid ephemeral-storage value passes",
input: api.ResourceConfiguration{
"*": api.ResourceRequirements{
Requests: api.ResourceList{
"ephemeral-storage": "60Gi",
},
Limits: api.ResourceList{
"ephemeral-storage": "100Gi",
},
},
},
expectedErr: false,
},
{
name: "valid shm value passes",
input: api.ResourceConfiguration{
Expand Down

0 comments on commit d57b243

Please sign in to comment.