Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DPTP-4274] Allow requests for ephemeral-storage in validation/config.go #4444

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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